All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.netbeans.modules.css.parser.CssParser Maven / Gradle / Ivy

The newest version!
/* Generated By:JJTree&JavaCC: Do not edit this line. CssParser.java */
package org.netbeans.modules.css.parser;

import java.util.*;

public class CssParser/*@bgen(jjtree)*/implements CssParserTreeConstants, CssParserConstants {/*@bgen(jjtree)*/
  protected JJTCssParserState jjtree = new JJTCssParserState();
    private ArrayList errors = new ArrayList();

    public CssParser() {
       this((CharStream) null);
       // change manager to our patched one:
       token_source = new PatchedCssParserTokenManager(null);
    }

    public List errors() {
        return errors;
    }

  final public SimpleNode styleSheet() throws ParseException {
                          /*@bgen(jjtree) styleSheet */
  SimpleNode jjtn000 = new SimpleNode(JJTSTYLESHEET);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
  jjtn000.jjtSetFirstToken(getToken(1));
    try {
      styleSheetRuleList();
    jjtree.closeNodeScope(jjtn000, true);
    jjtc000 = false;
    jjtn000.jjtSetLastToken(getToken(0));
    {if (true) return jjtn000;}
    } catch (Throwable jjte000) {
    if (jjtc000) {
      jjtree.clearNodeScope(jjtn000);
      jjtc000 = false;
    } else {
      jjtree.popNode();
    }
    if (jjte000 instanceof RuntimeException) {
      {if (true) throw (RuntimeException)jjte000;}
    }
    if (jjte000 instanceof ParseException) {
      {if (true) throw (ParseException)jjte000;}
    }
    {if (true) throw (Error)jjte000;}
    } finally {
    if (jjtc000) {
      jjtree.closeNodeScope(jjtn000, true);
      jjtn000.jjtSetLastToken(getToken(0));
    }
    }
    throw new Error("Missing return statement in function");
  }

  final public void styleSheetRuleList() throws ParseException {
                            /*@bgen(jjtree) styleSheetRuleList */
  SimpleNode jjtn000 = new SimpleNode(JJTSTYLESHEETRULELIST);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
  jjtn000.jjtSetFirstToken(getToken(1));
    try {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case CHARSET_SYM:
        charsetRule();
        break;
      default:
        jj_la1[0] = jj_gen;
        ;
      }
      label_1:
      while (true) {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case S:
        case COMMENT:
        case CDO:
        case CDC:
          ;
          break;
        default:
          jj_la1[1] = jj_gen;
          break label_1;
        }
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case S:
        case COMMENT:
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case S:
            jj_consume_token(S);
            break;
          case COMMENT:
            jj_consume_token(COMMENT);
            break;
          default:
            jj_la1[2] = jj_gen;
            jj_consume_token(-1);
            throw new ParseException();
          }
          break;
        case CDO:
          jj_consume_token(CDO);
          break;
        case CDC:
          jj_consume_token(CDC);
          break;
        default:
          jj_la1[3] = jj_gen;
          jj_consume_token(-1);
          throw new ParseException();
        }
      }
      label_2:
      while (true) {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case IMPORT_SYM:
          ;
          break;
        default:
          jj_la1[4] = jj_gen;
          break label_2;
        }
        importRule();
        label_3:
        while (true) {
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case S:
          case COMMENT:
          case CDO:
          case CDC:
            ;
            break;
          default:
            jj_la1[5] = jj_gen;
            break label_3;
          }
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case S:
          case COMMENT:
            switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
            case S:
              jj_consume_token(S);
              break;
            case COMMENT:
              jj_consume_token(COMMENT);
              break;
            default:
              jj_la1[6] = jj_gen;
              jj_consume_token(-1);
              throw new ParseException();
            }
            break;
          case CDO:
            jj_consume_token(CDO);
            break;
          case CDC:
            jj_consume_token(CDC);
            break;
          default:
            jj_la1[7] = jj_gen;
            jj_consume_token(-1);
            throw new ParseException();
          }
        }
      }
      label_4:
      while (true) {
        ;
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case 0:
          jj_consume_token(0);
              {if (true) return;}
          break;
        default:
          jj_la1[8] = jj_gen;
          rule();
        }
        label_5:
        while (true) {
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case S:
          case COMMENT:
          case CDO:
          case CDC:
            ;
            break;
          default:
            jj_la1[9] = jj_gen;
            break label_5;
          }
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case S:
          case COMMENT:
            switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
            case S:
              jj_consume_token(S);
              break;
            case COMMENT:
              jj_consume_token(COMMENT);
              break;
            default:
              jj_la1[10] = jj_gen;
              jj_consume_token(-1);
              throw new ParseException();
            }
            break;
          case CDO:
            jj_consume_token(CDO);
            break;
          case CDC:
            jj_consume_token(CDC);
            break;
          default:
            jj_la1[11] = jj_gen;
            jj_consume_token(-1);
            throw new ParseException();
          }
        }
      }
    } catch (Throwable jjte000) {
    if (jjtc000) {
      jjtree.clearNodeScope(jjtn000);
      jjtc000 = false;
    } else {
      jjtree.popNode();
    }
    if (jjte000 instanceof RuntimeException) {
      {if (true) throw (RuntimeException)jjte000;}
    }
    if (jjte000 instanceof ParseException) {
      {if (true) throw (ParseException)jjte000;}
    }
    {if (true) throw (Error)jjte000;}
    } finally {
    if (jjtc000) {
      jjtree.closeNodeScope(jjtn000, true);
      jjtn000.jjtSetLastToken(getToken(0));
    }
    }
  }

  final public void rule() throws ParseException {
              /*@bgen(jjtree) rule */
  SimpleNode jjtn000 = new SimpleNode(JJTRULE);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
  jjtn000.jjtSetFirstToken(getToken(1));
    try {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case DOT:
      case COLON:
      case ASTERISK:
      case LSQUARE:
      case HASH:
      case GENERATED:
      case IDENT:
        styleRule();
        break;
      case MEDIA_SYM:
        mediaRule();
        break;
      case PAGE_SYM:
        pageRule();
        break;
      case FONT_FACE_SYM:
        fontFaceRule();
        break;
      case ATKEYWORD:
        unknownRule();
        break;
      default:
        jj_la1[12] = jj_gen;
        error_skip_to_whitespace();
      }
    } catch (Throwable jjte000) {
      if (jjtc000) {
        jjtree.clearNodeScope(jjtn000);
        jjtc000 = false;
      } else {
        jjtree.popNode();
      }
      if (jjte000 instanceof RuntimeException) {
        {if (true) throw (RuntimeException)jjte000;}
      }
      if (jjte000 instanceof ParseException) {
        {if (true) throw (ParseException)jjte000;}
      }
      {if (true) throw (Error)jjte000;}
    } finally {
      if (jjtc000) {
        jjtree.closeNodeScope(jjtn000, true);
        jjtn000.jjtSetLastToken(getToken(0));
      }
    }
  }

//
// This is used by ASTStyleSheet.insertRule to parse a single rule
//
  final public void styleSheetRuleSingle() throws ParseException {
                              /*@bgen(jjtree) styleSheetRuleSingle */
  SimpleNode jjtn000 = new SimpleNode(JJTSTYLESHEETRULESINGLE);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
  jjtn000.jjtSetFirstToken(getToken(1));
    try {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case CHARSET_SYM:
        charsetRule();
        break;
      case IMPORT_SYM:
        importRule();
        break;
      case DOT:
      case COLON:
      case ASTERISK:
      case LSQUARE:
      case HASH:
      case GENERATED:
      case IDENT:
        styleRule();
        break;
      case MEDIA_SYM:
        mediaRule();
        break;
      case PAGE_SYM:
        pageRule();
        break;
      case FONT_FACE_SYM:
        fontFaceRule();
        break;
      case ATKEYWORD:
        unknownRule();
        break;
      default:
        jj_la1[13] = jj_gen;
        jj_consume_token(-1);
        throw new ParseException();
      }
    } catch (Throwable jjte000) {
    if (jjtc000) {
      jjtree.clearNodeScope(jjtn000);
      jjtc000 = false;
    } else {
      jjtree.popNode();
    }
    if (jjte000 instanceof RuntimeException) {
      {if (true) throw (RuntimeException)jjte000;}
    }
    if (jjte000 instanceof ParseException) {
      {if (true) throw (ParseException)jjte000;}
    }
    {if (true) throw (Error)jjte000;}
    } finally {
    if (jjtc000) {
      jjtree.closeNodeScope(jjtn000, true);
      jjtn000.jjtSetLastToken(getToken(0));
    }
    }
  }

  final public void charsetRule() throws ParseException {
                      /*@bgen(jjtree) charsetRule */
  SimpleNode jjtn000 = new SimpleNode(JJTCHARSETRULE);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
  jjtn000.jjtSetFirstToken(getToken(1));
    try {
      jj_consume_token(CHARSET_SYM);
      label_6:
      while (true) {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case S:
        case COMMENT:
          ;
          break;
        default:
          jj_la1[14] = jj_gen;
          break label_6;
        }
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case S:
          jj_consume_token(S);
          break;
        case COMMENT:
          jj_consume_token(COMMENT);
          break;
        default:
          jj_la1[15] = jj_gen;
          jj_consume_token(-1);
          throw new ParseException();
        }
      }
      jj_consume_token(STRING);
      label_7:
      while (true) {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case S:
        case COMMENT:
          ;
          break;
        default:
          jj_la1[16] = jj_gen;
          break label_7;
        }
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case S:
          jj_consume_token(S);
          break;
        case COMMENT:
          jj_consume_token(COMMENT);
          break;
        default:
          jj_la1[17] = jj_gen;
          jj_consume_token(-1);
          throw new ParseException();
        }
      }
      jj_consume_token(SEMICOLON);
    } finally {
    if (jjtc000) {
      jjtree.closeNodeScope(jjtn000, true);
      jjtn000.jjtSetLastToken(getToken(0));
    }
    }
  }

  final public void unknownRule() throws ParseException {
                     /*@bgen(jjtree) unknownRule */
  SimpleNode jjtn000 = new SimpleNode(JJTUNKNOWNRULE);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
  jjtn000.jjtSetFirstToken(getToken(1));
    try {
      jj_consume_token(ATKEYWORD);
      skip();
    } finally {
      if (jjtc000) {
        jjtree.closeNodeScope(jjtn000, true);
        jjtn000.jjtSetLastToken(getToken(0));
      }
    }
  }

  final public void importRule() throws ParseException {
                     /*@bgen(jjtree) importRule */
  SimpleNode jjtn000 = new SimpleNode(JJTIMPORTRULE);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
  jjtn000.jjtSetFirstToken(getToken(1));
    try {
      jj_consume_token(IMPORT_SYM);
      label_8:
      while (true) {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case S:
        case COMMENT:
          ;
          break;
        default:
          jj_la1[18] = jj_gen;
          break label_8;
        }
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case S:
          jj_consume_token(S);
          break;
        case COMMENT:
          jj_consume_token(COMMENT);
          break;
        default:
          jj_la1[19] = jj_gen;
          jj_consume_token(-1);
          throw new ParseException();
        }
      }
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case STRING:
        jj_consume_token(STRING);
        break;
      case URI:
        jj_consume_token(URI);
        break;
      default:
        jj_la1[20] = jj_gen;
        jj_consume_token(-1);
        throw new ParseException();
      }
      label_9:
      while (true) {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case S:
        case COMMENT:
          ;
          break;
        default:
          jj_la1[21] = jj_gen;
          break label_9;
        }
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case S:
          jj_consume_token(S);
          break;
        case COMMENT:
          jj_consume_token(COMMENT);
          break;
        default:
          jj_la1[22] = jj_gen;
          jj_consume_token(-1);
          throw new ParseException();
        }
      }
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case GENERATED:
      case IDENT:
        mediaList();
        break;
      default:
        jj_la1[23] = jj_gen;
        ;
      }
      jj_consume_token(SEMICOLON);
    } catch (Throwable jjte000) {
      if (jjtc000) {
        jjtree.clearNodeScope(jjtn000);
        jjtc000 = false;
      } else {
        jjtree.popNode();
      }
      if (jjte000 instanceof RuntimeException) {
        {if (true) throw (RuntimeException)jjte000;}
      }
      if (jjte000 instanceof ParseException) {
        {if (true) throw (ParseException)jjte000;}
      }
      {if (true) throw (Error)jjte000;}
    } finally {
      if (jjtc000) {
        jjtree.closeNodeScope(jjtn000, true);
        jjtn000.jjtSetLastToken(getToken(0));
      }
    }
  }

  final public void mediaRule() throws ParseException {
                    /*@bgen(jjtree) mediaRule */
  SimpleNode jjtn000 = new SimpleNode(JJTMEDIARULE);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
  jjtn000.jjtSetFirstToken(getToken(1));
    try {
      try {
        jj_consume_token(MEDIA_SYM);
        label_10:
        while (true) {
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case S:
          case COMMENT:
            ;
            break;
          default:
            jj_la1[24] = jj_gen;
            break label_10;
          }
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case S:
            jj_consume_token(S);
            break;
          case COMMENT:
            jj_consume_token(COMMENT);
            break;
          default:
            jj_la1[25] = jj_gen;
            jj_consume_token(-1);
            throw new ParseException();
          }
        }
        mediaList();
        jj_consume_token(LBRACE);
        label_11:
        while (true) {
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case S:
          case COMMENT:
            ;
            break;
          default:
            jj_la1[26] = jj_gen;
            break label_11;
          }
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case S:
            jj_consume_token(S);
            break;
          case COMMENT:
            jj_consume_token(COMMENT);
            break;
          default:
            jj_la1[27] = jj_gen;
            jj_consume_token(-1);
            throw new ParseException();
          }
        }
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case DOT:
        case COLON:
        case ASTERISK:
        case LSQUARE:
        case HASH:
        case GENERATED:
        case PAGE_SYM:
        case ATKEYWORD:
        case IDENT:
          mediaRuleList();
          break;
        default:
          jj_la1[28] = jj_gen;
          ;
        }
        jj_consume_token(RBRACE);
      } catch (ParseException e) {
        reportError(e);
        error_skipblock();
      }
    } catch (Throwable jjte000) {
      if (jjtc000) {
        jjtree.clearNodeScope(jjtn000);
        jjtc000 = false;
      } else {
        jjtree.popNode();
      }
      if (jjte000 instanceof RuntimeException) {
        {if (true) throw (RuntimeException)jjte000;}
      }
      if (jjte000 instanceof ParseException) {
        {if (true) throw (ParseException)jjte000;}
      }
      {if (true) throw (Error)jjte000;}
    } finally {
      if (jjtc000) {
        jjtree.closeNodeScope(jjtn000, true);
        jjtn000.jjtSetLastToken(getToken(0));
      }
    }
  }

  final public void mediaList() throws ParseException {
                   /*@bgen(jjtree) mediaList */
  SimpleNode jjtn000 = new SimpleNode(JJTMEDIALIST);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
  jjtn000.jjtSetFirstToken(getToken(1));
    try {
      medium();
      label_12:
      while (true) {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case COMMA:
          ;
          break;
        default:
          jj_la1[29] = jj_gen;
          break label_12;
        }
        jj_consume_token(COMMA);
        label_13:
        while (true) {
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case S:
          case COMMENT:
            ;
            break;
          default:
            jj_la1[30] = jj_gen;
            break label_13;
          }
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case S:
            jj_consume_token(S);
            break;
          case COMMENT:
            jj_consume_token(COMMENT);
            break;
          default:
            jj_la1[31] = jj_gen;
            jj_consume_token(-1);
            throw new ParseException();
          }
        }
        medium();
      }
    } catch (Throwable jjte000) {
      if (jjtc000) {
        jjtree.clearNodeScope(jjtn000);
        jjtc000 = false;
      } else {
        jjtree.popNode();
      }
      if (jjte000 instanceof RuntimeException) {
        {if (true) throw (RuntimeException)jjte000;}
      }
      if (jjte000 instanceof ParseException) {
        {if (true) throw (ParseException)jjte000;}
      }
      {if (true) throw (Error)jjte000;}
    } finally {
      if (jjtc000) {
        jjtree.closeNodeScope(jjtn000, true);
        jjtn000.jjtSetLastToken(getToken(0));
      }
    }
  }

  final public void mediaRuleList() throws ParseException {
                        /*@bgen(jjtree) mediaRuleList */
  SimpleNode jjtn000 = new SimpleNode(JJTMEDIARULELIST);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
  jjtn000.jjtSetFirstToken(getToken(1));
    try {
      label_14:
      while (true) {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case DOT:
        case COLON:
        case ASTERISK:
        case LSQUARE:
        case HASH:
        case GENERATED:
        case IDENT:
          styleRule();
          break;
        case PAGE_SYM:
          pageRule();
          break;
        case ATKEYWORD:
          unknownRule();
          break;
        default:
          jj_la1[32] = jj_gen;
          jj_consume_token(-1);
          throw new ParseException();
        }
        label_15:
        while (true) {
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case S:
          case COMMENT:
            ;
            break;
          default:
            jj_la1[33] = jj_gen;
            break label_15;
          }
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case S:
            jj_consume_token(S);
            break;
          case COMMENT:
            jj_consume_token(COMMENT);
            break;
          default:
            jj_la1[34] = jj_gen;
            jj_consume_token(-1);
            throw new ParseException();
          }
        }
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case DOT:
        case COLON:
        case ASTERISK:
        case LSQUARE:
        case HASH:
        case GENERATED:
        case PAGE_SYM:
        case ATKEYWORD:
        case IDENT:
          ;
          break;
        default:
          jj_la1[35] = jj_gen;
          break label_14;
        }
      }
    } catch (Throwable jjte000) {
    if (jjtc000) {
      jjtree.clearNodeScope(jjtn000);
      jjtc000 = false;
    } else {
      jjtree.popNode();
    }
    if (jjte000 instanceof RuntimeException) {
      {if (true) throw (RuntimeException)jjte000;}
    }
    if (jjte000 instanceof ParseException) {
      {if (true) throw (ParseException)jjte000;}
    }
    {if (true) throw (Error)jjte000;}
    } finally {
    if (jjtc000) {
      jjtree.closeNodeScope(jjtn000, true);
      jjtn000.jjtSetLastToken(getToken(0));
    }
    }
  }

  final public void mediaRuleSingle() throws ParseException {
 /*@bgen(jjtree) mediaRuleSingle */
  SimpleNode jjtn000 = new SimpleNode(JJTMEDIARULESINGLE);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
  jjtn000.jjtSetFirstToken(getToken(1));
    try {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case DOT:
      case COLON:
      case ASTERISK:
      case LSQUARE:
      case HASH:
      case GENERATED:
      case IDENT:
        styleRule();
        break;
      case PAGE_SYM:
        pageRule();
        break;
      case ATKEYWORD:
        unknownRule();
        break;
      default:
        jj_la1[36] = jj_gen;
        jj_consume_token(-1);
        throw new ParseException();
      }
    } catch (Throwable jjte000) {
    if (jjtc000) {
      jjtree.clearNodeScope(jjtn000);
      jjtc000 = false;
    } else {
      jjtree.popNode();
    }
    if (jjte000 instanceof RuntimeException) {
      {if (true) throw (RuntimeException)jjte000;}
    }
    if (jjte000 instanceof ParseException) {
      {if (true) throw (ParseException)jjte000;}
    }
    {if (true) throw (Error)jjte000;}
    } finally {
    if (jjtc000) {
      jjtree.closeNodeScope(jjtn000, true);
      jjtn000.jjtSetLastToken(getToken(0));
    }
    }
  }

  final public void medium() throws ParseException {
 /*@bgen(jjtree) medium */
  SimpleNode jjtn000 = new SimpleNode(JJTMEDIUM);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
  jjtn000.jjtSetFirstToken(getToken(1));
    try {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case IDENT:
        jj_consume_token(IDENT);
        break;
      case GENERATED:
        jj_consume_token(GENERATED);
        break;
      default:
        jj_la1[37] = jj_gen;
        jj_consume_token(-1);
        throw new ParseException();
      }
      label_16:
      while (true) {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case S:
        case COMMENT:
          ;
          break;
        default:
          jj_la1[38] = jj_gen;
          break label_16;
        }
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case S:
          jj_consume_token(S);
          break;
        case COMMENT:
          jj_consume_token(COMMENT);
          break;
        default:
          jj_la1[39] = jj_gen;
          jj_consume_token(-1);
          throw new ParseException();
        }
      }
    } finally {
    if (jjtc000) {
      jjtree.closeNodeScope(jjtn000, true);
      jjtn000.jjtSetLastToken(getToken(0));
    }
    }
  }

  final public void pageRule() throws ParseException {
 /*@bgen(jjtree) pageRule */
    SimpleNode jjtn000 = new SimpleNode(JJTPAGERULE);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
    jjtn000.jjtSetFirstToken(getToken(1));Token t = null;
    String s = null;
    boolean start = false;
    try {
      jj_consume_token(PAGE_SYM);
      label_17:
      while (true) {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case S:
        case COMMENT:
          ;
          break;
        default:
          jj_la1[40] = jj_gen;
          break label_17;
        }
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case S:
          jj_consume_token(S);
          break;
        case COMMENT:
          jj_consume_token(COMMENT);
          break;
        default:
          jj_la1[41] = jj_gen;
          jj_consume_token(-1);
          throw new ParseException();
        }
      }
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case COLON:
      case IDENT:
        if (jj_2_1(2)) {
          t = jj_consume_token(IDENT);
          label_18:
          while (true) {
            switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
            case S:
            case COMMENT:
              ;
              break;
            default:
              jj_la1[42] = jj_gen;
              break label_18;
            }
            switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
            case S:
              jj_consume_token(S);
              break;
            case COMMENT:
              jj_consume_token(COMMENT);
              break;
            default:
              jj_la1[43] = jj_gen;
              jj_consume_token(-1);
              throw new ParseException();
            }
          }
        } else {
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case IDENT:
            jj_consume_token(IDENT);
            pseudoPage();
            label_19:
            while (true) {
              switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
              case S:
              case COMMENT:
                ;
                break;
              default:
                jj_la1[44] = jj_gen;
                break label_19;
              }
              switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
              case S:
                jj_consume_token(S);
                break;
              case COMMENT:
                jj_consume_token(COMMENT);
                break;
              default:
                jj_la1[45] = jj_gen;
                jj_consume_token(-1);
                throw new ParseException();
              }
            }
            break;
          case COLON:
            pseudoPage();
            label_20:
            while (true) {
              switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
              case S:
              case COMMENT:
                ;
                break;
              default:
                jj_la1[46] = jj_gen;
                break label_20;
              }
              switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
              case S:
                jj_consume_token(S);
                break;
              case COMMENT:
                jj_consume_token(COMMENT);
                break;
              default:
                jj_la1[47] = jj_gen;
                jj_consume_token(-1);
                throw new ParseException();
              }
            }
            break;
          default:
            jj_la1[48] = jj_gen;
            jj_consume_token(-1);
            throw new ParseException();
          }
        }
        break;
      default:
        jj_la1[49] = jj_gen;
        ;
      }
      jj_consume_token(LBRACE);
      label_21:
      while (true) {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case S:
        case COMMENT:
          ;
          break;
        default:
          jj_la1[50] = jj_gen;
          break label_21;
        }
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case S:
          jj_consume_token(S);
          break;
        case COMMENT:
          jj_consume_token(COMMENT);
          break;
        default:
          jj_la1[51] = jj_gen;
          jj_consume_token(-1);
          throw new ParseException();
        }
      }
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case HASH:
      case GENERATED:
      case IDENT:
        declaration();
        break;
      default:
        jj_la1[52] = jj_gen;
        ;
      }
      label_22:
      while (true) {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case SEMICOLON:
          ;
          break;
        default:
          jj_la1[53] = jj_gen;
          break label_22;
        }
        jj_consume_token(SEMICOLON);
        label_23:
        while (true) {
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case S:
          case COMMENT:
            ;
            break;
          default:
            jj_la1[54] = jj_gen;
            break label_23;
          }
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case S:
            jj_consume_token(S);
            break;
          case COMMENT:
            jj_consume_token(COMMENT);
            break;
          default:
            jj_la1[55] = jj_gen;
            jj_consume_token(-1);
            throw new ParseException();
          }
        }
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case HASH:
        case GENERATED:
        case IDENT:
          declaration();
          break;
        default:
          jj_la1[56] = jj_gen;
          ;
        }
      }
      jj_consume_token(RBRACE);
    } catch (Throwable jjte000) {
          if (jjtc000) {
            jjtree.clearNodeScope(jjtn000);
            jjtc000 = false;
          } else {
            jjtree.popNode();
          }
          if (jjte000 instanceof RuntimeException) {
            {if (true) throw (RuntimeException)jjte000;}
          }
          if (jjte000 instanceof ParseException) {
            {if (true) throw (ParseException)jjte000;}
          }
          {if (true) throw (Error)jjte000;}
    } finally {
          if (jjtc000) {
            jjtree.closeNodeScope(jjtn000, true);
            jjtn000.jjtSetLastToken(getToken(0));
          }
    }
  }

//
// pseudoPage
//   : ':' IDENT
//   ;
//
  final public void pseudoPage() throws ParseException {
 /*@bgen(jjtree) pseudoPage */
  SimpleNode jjtn000 = new SimpleNode(JJTPSEUDOPAGE);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
  jjtn000.jjtSetFirstToken(getToken(1));
    try {
      jj_consume_token(COLON);
      jj_consume_token(IDENT);
    } finally {
    if (jjtc000) {
      jjtree.closeNodeScope(jjtn000, true);
      jjtn000.jjtSetLastToken(getToken(0));
    }
    }
  }

//
// font_face
//   : FONT_FACE_SYM S*
//     '{' S* declaration [ ';' S* declaration ]* '}' S*
//   ;
//
  final public void fontFaceRule() throws ParseException {
 /*@bgen(jjtree) fontFaceRule */
  SimpleNode jjtn000 = new SimpleNode(JJTFONTFACERULE);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
  jjtn000.jjtSetFirstToken(getToken(1));
    try {
      jj_consume_token(FONT_FACE_SYM);
      label_24:
      while (true) {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case S:
        case COMMENT:
          ;
          break;
        default:
          jj_la1[57] = jj_gen;
          break label_24;
        }
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case S:
          jj_consume_token(S);
          break;
        case COMMENT:
          jj_consume_token(COMMENT);
          break;
        default:
          jj_la1[58] = jj_gen;
          jj_consume_token(-1);
          throw new ParseException();
        }
      }
      jj_consume_token(LBRACE);
      label_25:
      while (true) {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case S:
        case COMMENT:
          ;
          break;
        default:
          jj_la1[59] = jj_gen;
          break label_25;
        }
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case S:
          jj_consume_token(S);
          break;
        case COMMENT:
          jj_consume_token(COMMENT);
          break;
        default:
          jj_la1[60] = jj_gen;
          jj_consume_token(-1);
          throw new ParseException();
        }
      }
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case HASH:
      case GENERATED:
      case IDENT:
        declaration();
        break;
      default:
        jj_la1[61] = jj_gen;
        ;
      }
      label_26:
      while (true) {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case SEMICOLON:
          ;
          break;
        default:
          jj_la1[62] = jj_gen;
          break label_26;
        }
        jj_consume_token(SEMICOLON);
        label_27:
        while (true) {
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case S:
          case COMMENT:
            ;
            break;
          default:
            jj_la1[63] = jj_gen;
            break label_27;
          }
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case S:
            jj_consume_token(S);
            break;
          case COMMENT:
            jj_consume_token(COMMENT);
            break;
          default:
            jj_la1[64] = jj_gen;
            jj_consume_token(-1);
            throw new ParseException();
          }
        }
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case HASH:
        case GENERATED:
        case IDENT:
          declaration();
          break;
        default:
          jj_la1[65] = jj_gen;
          ;
        }
      }
      jj_consume_token(RBRACE);
    } catch (Throwable jjte000) {
          if (jjtc000) {
            jjtree.clearNodeScope(jjtn000);
            jjtc000 = false;
          } else {
            jjtree.popNode();
          }
          if (jjte000 instanceof RuntimeException) {
            {if (true) throw (RuntimeException)jjte000;}
          }
          if (jjte000 instanceof ParseException) {
            {if (true) throw (ParseException)jjte000;}
          }
          {if (true) throw (Error)jjte000;}
    } finally {
          if (jjtc000) {
            jjtree.closeNodeScope(jjtn000, true);
            jjtn000.jjtSetLastToken(getToken(0));
          }
    }
  }

//
// operator
//   : '/' S* | ',' S* |
//   ;
//
  final public void operator() throws ParseException {
 /*@bgen(jjtree) operator */
  SimpleNode jjtn000 = new SimpleNode(JJTOPERATOR);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
  jjtn000.jjtSetFirstToken(getToken(1));
    try {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case SLASH:
        jj_consume_token(SLASH);
        label_28:
        while (true) {
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case S:
          case COMMENT:
            ;
            break;
          default:
            jj_la1[66] = jj_gen;
            break label_28;
          }
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case S:
            jj_consume_token(S);
            break;
          case COMMENT:
            jj_consume_token(COMMENT);
            break;
          default:
            jj_la1[67] = jj_gen;
            jj_consume_token(-1);
            throw new ParseException();
          }
        }
        break;
      case COMMA:
        jj_consume_token(COMMA);
        label_29:
        while (true) {
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case S:
          case COMMENT:
            ;
            break;
          default:
            jj_la1[68] = jj_gen;
            break label_29;
          }
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case S:
            jj_consume_token(S);
            break;
          case COMMENT:
            jj_consume_token(COMMENT);
            break;
          default:
            jj_la1[69] = jj_gen;
            jj_consume_token(-1);
            throw new ParseException();
          }
        }
        break;
      default:
        jj_la1[70] = jj_gen;
        jj_consume_token(-1);
        throw new ParseException();
      }
    } finally {
    if (jjtc000) {
      jjtree.closeNodeScope(jjtn000, true);
      jjtn000.jjtSetLastToken(getToken(0));
    }
    }
  }

//
// combinator
//   : '+' S* | '>' S* |
//   ;
//
  final public void combinator() throws ParseException {
 /*@bgen(jjtree) combinator */
  SimpleNode jjtn000 = new SimpleNode(JJTCOMBINATOR);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
  jjtn000.jjtSetFirstToken(getToken(1));
    try {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case PLUS:
        jj_consume_token(PLUS);
        label_30:
        while (true) {
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case S:
          case COMMENT:
            ;
            break;
          default:
            jj_la1[71] = jj_gen;
            break label_30;
          }
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case S:
            jj_consume_token(S);
            break;
          case COMMENT:
            jj_consume_token(COMMENT);
            break;
          default:
            jj_la1[72] = jj_gen;
            jj_consume_token(-1);
            throw new ParseException();
          }
        }
        break;
      case GT:
        jj_consume_token(GT);
        label_31:
        while (true) {
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case S:
          case COMMENT:
            ;
            break;
          default:
            jj_la1[73] = jj_gen;
            break label_31;
          }
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case S:
            jj_consume_token(S);
            break;
          case COMMENT:
            jj_consume_token(COMMENT);
            break;
          default:
            jj_la1[74] = jj_gen;
            jj_consume_token(-1);
            throw new ParseException();
          }
        }
        break;
      case S:
      case COMMENT:
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case S:
          jj_consume_token(S);
          break;
        case COMMENT:
          jj_consume_token(COMMENT);
          break;
        default:
          jj_la1[75] = jj_gen;
          jj_consume_token(-1);
          throw new ParseException();
        }
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case PLUS:
        case GT:
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case PLUS:
            jj_consume_token(PLUS);
            break;
          case GT:
            jj_consume_token(GT);
            break;
          default:
            jj_la1[76] = jj_gen;
            jj_consume_token(-1);
            throw new ParseException();
          }
          label_32:
          while (true) {
            switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
            case S:
            case COMMENT:
              ;
              break;
            default:
              jj_la1[77] = jj_gen;
              break label_32;
            }
            switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
            case S:
              jj_consume_token(S);
              break;
            case COMMENT:
              jj_consume_token(COMMENT);
              break;
            default:
              jj_la1[78] = jj_gen;
              jj_consume_token(-1);
              throw new ParseException();
            }
          }
          break;
        default:
          jj_la1[79] = jj_gen;
          ;
        }
        break;
      default:
        jj_la1[80] = jj_gen;
        jj_consume_token(-1);
        throw new ParseException();
      }
    } finally {
    if (jjtc000) {
      jjtree.closeNodeScope(jjtn000, true);
      jjtn000.jjtSetLastToken(getToken(0));
    }
    }
  }

//
// unary_operator
//   : '-' | '+'
//   ;
//
  final public void unaryOperator() throws ParseException {
 /*@bgen(jjtree) unaryOperator */
  SimpleNode jjtn000 = new SimpleNode(JJTUNARYOPERATOR);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
  jjtn000.jjtSetFirstToken(getToken(1));
    try {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case MINUS:
        jj_consume_token(MINUS);
        break;
      case PLUS:
        jj_consume_token(PLUS);
        break;
      default:
        jj_la1[81] = jj_gen;
        jj_consume_token(-1);
        throw new ParseException();
      }
    } finally {
    if (jjtc000) {
      jjtree.closeNodeScope(jjtn000, true);
      jjtn000.jjtSetLastToken(getToken(0));
    }
    }
  }

//
// property
//   : IDENT S*
//   ;
//
  final public void property() throws ParseException {
 /*@bgen(jjtree) property */
  SimpleNode jjtn000 = new SimpleNode(JJTPROPERTY);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
  jjtn000.jjtSetFirstToken(getToken(1));
    try {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case HASH:
        jj_consume_token(HASH);
        break;
      case IDENT:
        jj_consume_token(IDENT);
        break;
      case GENERATED:
        jj_consume_token(GENERATED);
        break;
      default:
        jj_la1[82] = jj_gen;
        jj_consume_token(-1);
        throw new ParseException();
      }
      label_33:
      while (true) {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case S:
        case COMMENT:
          ;
          break;
        default:
          jj_la1[83] = jj_gen;
          break label_33;
        }
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case S:
          jj_consume_token(S);
          break;
        case COMMENT:
          jj_consume_token(COMMENT);
          break;
        default:
          jj_la1[84] = jj_gen;
          jj_consume_token(-1);
          throw new ParseException();
        }
      }
    } finally {
      if (jjtc000) {
        jjtree.closeNodeScope(jjtn000, true);
        jjtn000.jjtSetLastToken(getToken(0));
      }
    }
  }

//
// ruleset
//   : selector [ ',' S* selector ]*
//     '{' S* declaration [ ';' S* declaration ]* '}' S*
//   ;
//

//TODO marek: resolve the error reporting and recovery in styleRule()
  final public void styleRule() throws ParseException {
 /*@bgen(jjtree) styleRule */
  SimpleNode jjtn000 = new SimpleNode(JJTSTYLERULE);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
  jjtn000.jjtSetFirstToken(getToken(1));
    try {
      try {
        selectorList();
        jj_consume_token(LBRACE);
        label_34:
        while (true) {
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case S:
          case COMMENT:
            ;
            break;
          default:
            jj_la1[85] = jj_gen;
            break label_34;
          }
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case S:
            jj_consume_token(S);
            break;
          case COMMENT:
            jj_consume_token(COMMENT);
            break;
          default:
            jj_la1[86] = jj_gen;
            jj_consume_token(-1);
            throw new ParseException();
          }
        }
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case HASH:
        case GENERATED:
        case IDENT:
          declaration();
          break;
        default:
          jj_la1[87] = jj_gen;
          ;
        }
        label_35:
        while (true) {
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case SEMICOLON:
            ;
            break;
          default:
            jj_la1[88] = jj_gen;
            break label_35;
          }
          jj_consume_token(SEMICOLON);
          label_36:
          while (true) {
            switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
            case S:
            case COMMENT:
              ;
              break;
            default:
              jj_la1[89] = jj_gen;
              break label_36;
            }
            switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
            case S:
              jj_consume_token(S);
              break;
            case COMMENT:
              jj_consume_token(COMMENT);
              break;
            default:
              jj_la1[90] = jj_gen;
              jj_consume_token(-1);
              throw new ParseException();
            }
          }
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case HASH:
          case GENERATED:
          case IDENT:
            declaration();
            break;
          default:
            jj_la1[91] = jj_gen;
            ;
          }
        }
        jj_consume_token(RBRACE);
      } catch (ParseException e) {
        reportError(e);
        error_skipblock();
      }
    } catch (Throwable jjte000) {
      if (jjtc000) {
        jjtree.clearNodeScope(jjtn000);
        jjtc000 = false;
      } else {
        jjtree.popNode();
      }
      if (jjte000 instanceof RuntimeException) {
        {if (true) throw (RuntimeException)jjte000;}
      }
      if (jjte000 instanceof ParseException) {
        {if (true) throw (ParseException)jjte000;}
      }
      {if (true) throw (Error)jjte000;}
    } finally {
      if (jjtc000) {
        jjtree.closeNodeScope(jjtn000, true);
        jjtn000.jjtSetLastToken(getToken(0));
      }
    }
  }

  final public void selectorList() throws ParseException {
 /*@bgen(jjtree) selectorList */
  SimpleNode jjtn000 = new SimpleNode(JJTSELECTORLIST);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
  jjtn000.jjtSetFirstToken(getToken(1));
    try {
      try {
        selector();
        label_37:
        while (true) {
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case COMMA:
            ;
            break;
          default:
            jj_la1[92] = jj_gen;
            break label_37;
          }
          jj_consume_token(COMMA);
          label_38:
          while (true) {
            switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
            case S:
            case COMMENT:
              ;
              break;
            default:
              jj_la1[93] = jj_gen;
              break label_38;
            }
            switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
            case S:
              jj_consume_token(S);
              break;
            case COMMENT:
              jj_consume_token(COMMENT);
              break;
            default:
              jj_la1[94] = jj_gen;
              jj_consume_token(-1);
              throw new ParseException();
            }
          }
          selector();
        }
      } catch (ParseException e) {
        reportError(e);
      }
    } catch (Throwable jjte000) {
      if (jjtc000) {
        jjtree.clearNodeScope(jjtn000);
        jjtc000 = false;
      } else {
        jjtree.popNode();
      }
      if (jjte000 instanceof RuntimeException) {
        {if (true) throw (RuntimeException)jjte000;}
      }
      if (jjte000 instanceof ParseException) {
        {if (true) throw (ParseException)jjte000;}
      }
      {if (true) throw (Error)jjte000;}
    } finally {
      if (jjtc000) {
        jjtree.closeNodeScope(jjtn000, true);
        jjtn000.jjtSetLastToken(getToken(0));
      }
    }
  }

//
// selector
//   : simple_selector [ combinator simple_selector ]*
//   ;
//
  final public void selector() throws ParseException {
 /*@bgen(jjtree) selector */
  SimpleNode jjtn000 = new SimpleNode(JJTSELECTOR);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
  jjtn000.jjtSetFirstToken(getToken(1));
    try {
      try {
        simpleSelector();
        label_39:
        while (true) {
          if (jj_2_2(2)) {
            ;
          } else {
            break label_39;
          }
          combinator();
          simpleSelector();
        }
        label_40:
        while (true) {
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case S:
          case COMMENT:
            ;
            break;
          default:
            jj_la1[95] = jj_gen;
            break label_40;
          }
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case S:
            jj_consume_token(S);
            break;
          case COMMENT:
            jj_consume_token(COMMENT);
            break;
          default:
            jj_la1[96] = jj_gen;
            jj_consume_token(-1);
            throw new ParseException();
          }
        }
      } catch (ParseException e) {
        reportError(e);
        skipSelector();
      }
    } catch (Throwable jjte000) {
      if (jjtc000) {
        jjtree.clearNodeScope(jjtn000);
        jjtc000 = false;
      } else {
        jjtree.popNode();
      }
      if (jjte000 instanceof RuntimeException) {
        {if (true) throw (RuntimeException)jjte000;}
      }
      if (jjte000 instanceof ParseException) {
        {if (true) throw (ParseException)jjte000;}
      }
      {if (true) throw (Error)jjte000;}
    } finally {
      if (jjtc000) {
        jjtree.closeNodeScope(jjtn000, true);
        jjtn000.jjtSetLastToken(getToken(0));
      }
    }
  }

//
// simple_selector
//   : element_name? [ HASH | class | attrib | pseudo ]* S*
//   ;
//
  final public void simpleSelector() throws ParseException {
 /*@bgen(jjtree) simpleSelector */
  SimpleNode jjtn000 = new SimpleNode(JJTSIMPLESELECTOR);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
  jjtn000.jjtSetFirstToken(getToken(1));
    try {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case ASTERISK:
      case GENERATED:
      case IDENT:
        elementName();
        label_41:
        while (true) {
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case DOT:
          case COLON:
          case LSQUARE:
          case HASH:
            ;
            break;
          default:
            jj_la1[97] = jj_gen;
            break label_41;
          }
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case HASH:
            hash();
            break;
          case DOT:
            _class();
            break;
          case LSQUARE:
            attrib();
            break;
          case COLON:
            pseudo();
            break;
          default:
            jj_la1[98] = jj_gen;
            jj_consume_token(-1);
            throw new ParseException();
          }
        }
        break;
      case DOT:
      case COLON:
      case LSQUARE:
      case HASH:
        label_42:
        while (true) {
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case HASH:
            hash();
            break;
          case DOT:
            _class();
            break;
          case LSQUARE:
            attrib();
            break;
          case COLON:
            pseudo();
            break;
          default:
            jj_la1[99] = jj_gen;
            jj_consume_token(-1);
            throw new ParseException();
          }
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case DOT:
          case COLON:
          case LSQUARE:
          case HASH:
            ;
            break;
          default:
            jj_la1[100] = jj_gen;
            break label_42;
          }
        }
        break;
      default:
        jj_la1[101] = jj_gen;
        jj_consume_token(-1);
        throw new ParseException();
      }
    } catch (Throwable jjte000) {
      if (jjtc000) {
        jjtree.clearNodeScope(jjtn000);
        jjtc000 = false;
      } else {
        jjtree.popNode();
      }
      if (jjte000 instanceof RuntimeException) {
        {if (true) throw (RuntimeException)jjte000;}
      }
      if (jjte000 instanceof ParseException) {
        {if (true) throw (ParseException)jjte000;}
      }
      {if (true) throw (Error)jjte000;}
    } finally {
      if (jjtc000) {
        jjtree.closeNodeScope(jjtn000, true);
        jjtn000.jjtSetLastToken(getToken(0));
      }
    }
  }

//
// class
//   : '.' IDENT
//   ;
//
  final public void _class() throws ParseException {
 /*@bgen(jjtree) _class */
  SimpleNode jjtn000 = new SimpleNode(JJT_CLASS);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
  jjtn000.jjtSetFirstToken(getToken(1));
    try {
      jj_consume_token(DOT);
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case IDENT:
        jj_consume_token(IDENT);
        break;
      case GENERATED:
        jj_consume_token(GENERATED);
        break;
      default:
        jj_la1[102] = jj_gen;
        jj_consume_token(-1);
        throw new ParseException();
      }
    } finally {
      if (jjtc000) {
        jjtree.closeNodeScope(jjtn000, true);
        jjtn000.jjtSetLastToken(getToken(0));
      }
    }
  }

//
// element_name
//   : IDENT | '*'
//   ;
//
  final public void elementName() throws ParseException {
 /*@bgen(jjtree) elementName */
  SimpleNode jjtn000 = new SimpleNode(JJTELEMENTNAME);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
  jjtn000.jjtSetFirstToken(getToken(1));
    try {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case IDENT:
        jj_consume_token(IDENT);
        break;
      case GENERATED:
        jj_consume_token(GENERATED);
        break;
      case ASTERISK:
        jj_consume_token(ASTERISK);
        break;
      default:
        jj_la1[103] = jj_gen;
        jj_consume_token(-1);
        throw new ParseException();
      }
    } finally {
    if (jjtc000) {
      jjtree.closeNodeScope(jjtn000, true);
      jjtn000.jjtSetLastToken(getToken(0));
    }
    }
  }

//
// attrib
//   : '[' S* IDENT S* [ [ '=' | INCLUDES | DASHMATCH ] S*
//     [ IDENT | STRING ] S* ]? ']'
//   ;
//
  final public void attrib() throws ParseException {
 /*@bgen(jjtree) attrib */
  SimpleNode jjtn000 = new SimpleNode(JJTATTRIB);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
  jjtn000.jjtSetFirstToken(getToken(1));
    try {
      jj_consume_token(LSQUARE);
      label_43:
      while (true) {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case S:
        case COMMENT:
          ;
          break;
        default:
          jj_la1[104] = jj_gen;
          break label_43;
        }
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case S:
          jj_consume_token(S);
          break;
        case COMMENT:
          jj_consume_token(COMMENT);
          break;
        default:
          jj_la1[105] = jj_gen;
          jj_consume_token(-1);
          throw new ParseException();
        }
      }
      jj_consume_token(IDENT);
      label_44:
      while (true) {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case S:
        case COMMENT:
          ;
          break;
        default:
          jj_la1[106] = jj_gen;
          break label_44;
        }
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case S:
          jj_consume_token(S);
          break;
        case COMMENT:
          jj_consume_token(COMMENT);
          break;
        default:
          jj_la1[107] = jj_gen;
          jj_consume_token(-1);
          throw new ParseException();
        }
      }
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case EQUALS:
      case INCLUDES:
      case CSS3_BEGINS:
      case CSS3_ENDS:
      case CSS3_CONTAINS:
      case DASHMATCH:
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case EQUALS:
          jj_consume_token(EQUALS);
          break;
        case INCLUDES:
          jj_consume_token(INCLUDES);
          break;
        case DASHMATCH:
          jj_consume_token(DASHMATCH);
          break;
        case CSS3_BEGINS:
          jj_consume_token(CSS3_BEGINS);
          break;
        case CSS3_ENDS:
          jj_consume_token(CSS3_ENDS);
          break;
        case CSS3_CONTAINS:
          jj_consume_token(CSS3_CONTAINS);
          break;
        default:
          jj_la1[108] = jj_gen;
          jj_consume_token(-1);
          throw new ParseException();
        }
        label_45:
        while (true) {
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case S:
          case COMMENT:
            ;
            break;
          default:
            jj_la1[109] = jj_gen;
            break label_45;
          }
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case S:
            jj_consume_token(S);
            break;
          case COMMENT:
            jj_consume_token(COMMENT);
            break;
          default:
            jj_la1[110] = jj_gen;
            jj_consume_token(-1);
            throw new ParseException();
          }
        }
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case IDENT:
          jj_consume_token(IDENT);
          break;
        case STRING:
          jj_consume_token(STRING);
          break;
        default:
          jj_la1[111] = jj_gen;
          jj_consume_token(-1);
          throw new ParseException();
        }
        label_46:
        while (true) {
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case S:
          case COMMENT:
            ;
            break;
          default:
            jj_la1[112] = jj_gen;
            break label_46;
          }
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case S:
            jj_consume_token(S);
            break;
          case COMMENT:
            jj_consume_token(COMMENT);
            break;
          default:
            jj_la1[113] = jj_gen;
            jj_consume_token(-1);
            throw new ParseException();
          }
        }
        break;
      default:
        jj_la1[114] = jj_gen;
        ;
      }
      jj_consume_token(RSQUARE);
    } finally {
      if (jjtc000) {
        jjtree.closeNodeScope(jjtn000, true);
        jjtn000.jjtSetLastToken(getToken(0));
      }
    }
  }

//
// pseudo
//   : ':' [ IDENT | FUNCTION S* IDENT S* ')' ]
//   ;
//
  final public void pseudo() throws ParseException {
 /*@bgen(jjtree) pseudo */
  SimpleNode jjtn000 = new SimpleNode(JJTPSEUDO);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
  jjtn000.jjtSetFirstToken(getToken(1));
    try {
      jj_consume_token(COLON);
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case GENERATED:
      case IDENT:
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case IDENT:
          jj_consume_token(IDENT);
          break;
        case GENERATED:
          jj_consume_token(GENERATED);
          break;
        default:
          jj_la1[115] = jj_gen;
          jj_consume_token(-1);
          throw new ParseException();
        }
        break;
      case FUNCTION:
        jj_consume_token(FUNCTION);
        label_47:
        while (true) {
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case S:
          case COMMENT:
            ;
            break;
          default:
            jj_la1[116] = jj_gen;
            break label_47;
          }
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case S:
            jj_consume_token(S);
            break;
          case COMMENT:
            jj_consume_token(COMMENT);
            break;
          default:
            jj_la1[117] = jj_gen;
            jj_consume_token(-1);
            throw new ParseException();
          }
        }
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case DOT:
        case IDENT:
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case DOT:
            jj_consume_token(DOT);
            break;
          default:
            jj_la1[118] = jj_gen;
            ;
          }
          jj_consume_token(IDENT);
          break;
        case GENERATED:
          jj_consume_token(GENERATED);
          break;
        default:
          jj_la1[119] = jj_gen;
          jj_consume_token(-1);
          throw new ParseException();
        }
        label_48:
        while (true) {
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case S:
          case COMMENT:
            ;
            break;
          default:
            jj_la1[120] = jj_gen;
            break label_48;
          }
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case S:
            jj_consume_token(S);
            break;
          case COMMENT:
            jj_consume_token(COMMENT);
            break;
          default:
            jj_la1[121] = jj_gen;
            jj_consume_token(-1);
            throw new ParseException();
          }
        }
        jj_consume_token(RROUND);
        break;
      default:
        jj_la1[122] = jj_gen;
        jj_consume_token(-1);
        throw new ParseException();
      }
    } finally {
      if (jjtc000) {
        jjtree.closeNodeScope(jjtn000, true);
        jjtn000.jjtSetLastToken(getToken(0));
      }
    }
  }

  final public void hash() throws ParseException {
 /*@bgen(jjtree) hash */
  SimpleNode jjtn000 = new SimpleNode(JJTHASH);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
  jjtn000.jjtSetFirstToken(getToken(1));
    try {
      jj_consume_token(HASH);
    } finally {
      if (jjtc000) {
        jjtree.closeNodeScope(jjtn000, true);
        jjtn000.jjtSetLastToken(getToken(0));
      }
    }
  }

  final public void styleDeclaration() throws ParseException {
 /*@bgen(jjtree) styleDeclaration */
  SimpleNode jjtn000 = new SimpleNode(JJTSTYLEDECLARATION);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
  jjtn000.jjtSetFirstToken(getToken(1));
    try {
      jj_consume_token(LBRACE);
      label_49:
      while (true) {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case S:
        case COMMENT:
          ;
          break;
        default:
          jj_la1[123] = jj_gen;
          break label_49;
        }
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case S:
          jj_consume_token(S);
          break;
        case COMMENT:
          jj_consume_token(COMMENT);
          break;
        default:
          jj_la1[124] = jj_gen;
          jj_consume_token(-1);
          throw new ParseException();
        }
      }
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case HASH:
      case GENERATED:
      case IDENT:
        declaration();
        break;
      default:
        jj_la1[125] = jj_gen;
        ;
      }
      label_50:
      while (true) {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case SEMICOLON:
          ;
          break;
        default:
          jj_la1[126] = jj_gen;
          break label_50;
        }
        jj_consume_token(SEMICOLON);
        label_51:
        while (true) {
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case S:
          case COMMENT:
            ;
            break;
          default:
            jj_la1[127] = jj_gen;
            break label_51;
          }
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case S:
            jj_consume_token(S);
            break;
          case COMMENT:
            jj_consume_token(COMMENT);
            break;
          default:
            jj_la1[128] = jj_gen;
            jj_consume_token(-1);
            throw new ParseException();
          }
        }
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case HASH:
        case GENERATED:
        case IDENT:
          declaration();
          break;
        default:
          jj_la1[129] = jj_gen;
          ;
        }
      }
      jj_consume_token(RBRACE);
    } catch (Throwable jjte000) {
          if (jjtc000) {
            jjtree.clearNodeScope(jjtn000);
            jjtc000 = false;
          } else {
            jjtree.popNode();
          }
          if (jjte000 instanceof RuntimeException) {
            {if (true) throw (RuntimeException)jjte000;}
          }
          if (jjte000 instanceof ParseException) {
            {if (true) throw (ParseException)jjte000;}
          }
          {if (true) throw (Error)jjte000;}
    } finally {
          if (jjtc000) {
            jjtree.closeNodeScope(jjtn000, true);
            jjtn000.jjtSetLastToken(getToken(0));
          }
    }
  }

//
// declaration
//   : property ':' S* expr prio?
//   |
//   ;
//
  final public void declaration() throws ParseException {
 /*@bgen(jjtree) declaration */
  SimpleNode jjtn000 = new SimpleNode(JJTDECLARATION);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
  jjtn000.jjtSetFirstToken(getToken(1));
    try {
      try {
        if (jj_2_3(2147483647)) {
          jj_consume_token(GENERATED);
          label_52:
          while (true) {
            switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
            case S:
            case COMMENT:
              ;
              break;
            default:
              jj_la1[130] = jj_gen;
              break label_52;
            }
            switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
            case S:
              jj_consume_token(S);
              break;
            case COMMENT:
              jj_consume_token(COMMENT);
              break;
            default:
              jj_la1[131] = jj_gen;
              jj_consume_token(-1);
              throw new ParseException();
            }
          }
        } else {
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case HASH:
          case GENERATED:
          case IDENT:
            property();
            jj_consume_token(COLON);
            label_53:
            while (true) {
              switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
              case S:
              case COMMENT:
                ;
                break;
              default:
                jj_la1[132] = jj_gen;
                break label_53;
              }
              switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
              case S:
                jj_consume_token(S);
                break;
              case COMMENT:
                jj_consume_token(COMMENT);
                break;
              default:
                jj_la1[133] = jj_gen;
                jj_consume_token(-1);
                throw new ParseException();
              }
            }
            expr();
            switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
            case IMPORTANT_SYM:
              prio();
              break;
            default:
              jj_la1[134] = jj_gen;
              ;
            }
            break;
          default:
            jj_la1[135] = jj_gen;
            jj_consume_token(-1);
            throw new ParseException();
          }
        }
      } catch (ParseException e) {
        reportError(e);
        error_skipdecl(); //recovery

      }
    } catch (Throwable jjte000) {
      if (jjtc000) {
        jjtree.clearNodeScope(jjtn000);
        jjtc000 = false;
      } else {
        jjtree.popNode();
      }
      if (jjte000 instanceof RuntimeException) {
        {if (true) throw (RuntimeException)jjte000;}
      }
      if (jjte000 instanceof ParseException) {
        {if (true) throw (ParseException)jjte000;}
      }
      {if (true) throw (Error)jjte000;}
    } finally {
      if (jjtc000) {
        jjtree.closeNodeScope(jjtn000, true);
        jjtn000.jjtSetLastToken(getToken(0));
      }
    }
  }

//
// prio
//   : IMPORTANT_SYM S*
//   ;
//
  final public void prio() throws ParseException {
 /*@bgen(jjtree) prio */
  SimpleNode jjtn000 = new SimpleNode(JJTPRIO);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
  jjtn000.jjtSetFirstToken(getToken(1));
    try {
      jj_consume_token(IMPORTANT_SYM);
      label_54:
      while (true) {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case S:
        case COMMENT:
          ;
          break;
        default:
          jj_la1[136] = jj_gen;
          break label_54;
        }
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case S:
          jj_consume_token(S);
          break;
        case COMMENT:
          jj_consume_token(COMMENT);
          break;
        default:
          jj_la1[137] = jj_gen;
          jj_consume_token(-1);
          throw new ParseException();
        }
      }
    } finally {
    if (jjtc000) {
      jjtree.closeNodeScope(jjtn000, true);
      jjtn000.jjtSetLastToken(getToken(0));
    }
    }
  }

//
// expr
//   : term [ operator term ]*
//   ;
//
// TODO: Deal with the operator
//
  final public void expr() throws ParseException {
 /*@bgen(jjtree) expr */
  SimpleNode jjtn000 = new SimpleNode(JJTEXPR);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
  jjtn000.jjtSetFirstToken(getToken(1));
    try {
      term();
      label_55:
      while (true) {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case MSE:
        case COMMA:
        case DOT:
        case COLON:
        case SLASH:
        case PLUS:
        case MINUS:
        case EQUALS:
        case HASH:
        case STRING:
        case URI:
        case GENERATED:
        case INHERIT:
        case EMS:
        case EXS:
        case LENGTH_PX:
        case LENGTH_CM:
        case LENGTH_MM:
        case LENGTH_IN:
        case LENGTH_PT:
        case LENGTH_PC:
        case ANGLE_DEG:
        case ANGLE_RAD:
        case ANGLE_GRAD:
        case TIME_MS:
        case TIME_S:
        case FREQ_HZ:
        case FREQ_KHZ:
        case DIMEN:
        case PERCENTAGE:
        case NUMBER:
        case RGB:
        case FUNCTION:
        case IDENT:
        case UNICODERANGE:
          ;
          break;
        default:
          jj_la1[138] = jj_gen;
          break label_55;
        }
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case COMMA:
        case SLASH:
        case EQUALS:
          switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
          case COMMA:
          case SLASH:
            operator();
            break;
          case EQUALS:
            jj_consume_token(EQUALS);
            break;
          default:
            jj_la1[139] = jj_gen;
            jj_consume_token(-1);
            throw new ParseException();
          }
          break;
        default:
          jj_la1[140] = jj_gen;
          ;
        }
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case MSE:
        case PLUS:
        case MINUS:
        case HASH:
        case STRING:
        case URI:
        case GENERATED:
        case INHERIT:
        case EMS:
        case EXS:
        case LENGTH_PX:
        case LENGTH_CM:
        case LENGTH_MM:
        case LENGTH_IN:
        case LENGTH_PT:
        case LENGTH_PC:
        case ANGLE_DEG:
        case ANGLE_RAD:
        case ANGLE_GRAD:
        case TIME_MS:
        case TIME_S:
        case FREQ_HZ:
        case FREQ_KHZ:
        case DIMEN:
        case PERCENTAGE:
        case NUMBER:
        case RGB:
        case FUNCTION:
        case IDENT:
        case UNICODERANGE:
          term();
          break;
        case DOT:
          jj_consume_token(DOT);
          break;
        case COLON:
          jj_consume_token(COLON);
          break;
        default:
          jj_la1[141] = jj_gen;
          jj_consume_token(-1);
          throw new ParseException();
        }
      }
    } catch (Throwable jjte000) {
     if (jjtc000) {
       jjtree.clearNodeScope(jjtn000);
       jjtc000 = false;
     } else {
       jjtree.popNode();
     }
     if (jjte000 instanceof RuntimeException) {
       {if (true) throw (RuntimeException)jjte000;}
     }
     if (jjte000 instanceof ParseException) {
       {if (true) throw (ParseException)jjte000;}
     }
     {if (true) throw (Error)jjte000;}
    } finally {
     if (jjtc000) {
       jjtree.closeNodeScope(jjtn000, true);
       jjtn000.jjtSetLastToken(getToken(0));
     }
    }
  }

//
// term
//   : unary_operator?
//     [ NUMBER S* | PERCENTAGE S* | LENGTH S* | EMS S* | EXS S* | ANGLE S* |
//       TIME S* | FREQ S* | function ]
//   | STRING S* | IDENT S* | URI S* | RGB S* | UNICODERANGE S* | hexcolor
//   ;
//
  final public void term() throws ParseException {
 /*@bgen(jjtree) term */
  SimpleNode jjtn000 = new SimpleNode(JJTTERM);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
  jjtn000.jjtSetFirstToken(getToken(1));
    try {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case PLUS:
      case MINUS:
        unaryOperator();
        break;
      default:
        jj_la1[142] = jj_gen;
        ;
      }
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case MSE:
      case EMS:
      case EXS:
      case LENGTH_PX:
      case LENGTH_CM:
      case LENGTH_MM:
      case LENGTH_IN:
      case LENGTH_PT:
      case LENGTH_PC:
      case ANGLE_DEG:
      case ANGLE_RAD:
      case ANGLE_GRAD:
      case TIME_MS:
      case TIME_S:
      case FREQ_HZ:
      case FREQ_KHZ:
      case PERCENTAGE:
      case NUMBER:
      case FUNCTION:
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case NUMBER:
          jj_consume_token(NUMBER);
          break;
        case PERCENTAGE:
          jj_consume_token(PERCENTAGE);
          break;
        case LENGTH_PX:
          jj_consume_token(LENGTH_PX);
          break;
        case LENGTH_CM:
          jj_consume_token(LENGTH_CM);
          break;
        case LENGTH_MM:
          jj_consume_token(LENGTH_MM);
          break;
        case LENGTH_IN:
          jj_consume_token(LENGTH_IN);
          break;
        case LENGTH_PT:
          jj_consume_token(LENGTH_PT);
          break;
        case LENGTH_PC:
          jj_consume_token(LENGTH_PC);
          break;
        case EMS:
          jj_consume_token(EMS);
          break;
        case EXS:
          jj_consume_token(EXS);
          break;
        case ANGLE_DEG:
          jj_consume_token(ANGLE_DEG);
          break;
        case ANGLE_RAD:
          jj_consume_token(ANGLE_RAD);
          break;
        case ANGLE_GRAD:
          jj_consume_token(ANGLE_GRAD);
          break;
        case TIME_MS:
          jj_consume_token(TIME_MS);
          break;
        case TIME_S:
          jj_consume_token(TIME_S);
          break;
        case FREQ_HZ:
          jj_consume_token(FREQ_HZ);
          break;
        case FREQ_KHZ:
          jj_consume_token(FREQ_KHZ);
          break;
        case MSE:
          jj_consume_token(MSE);
          break;
        case FUNCTION:
          function();
          break;
        default:
          jj_la1[143] = jj_gen;
          jj_consume_token(-1);
          throw new ParseException();
        }
        break;
      case STRING:
        jj_consume_token(STRING);
        break;
      case IDENT:
        jj_consume_token(IDENT);
        break;
      case GENERATED:
        jj_consume_token(GENERATED);
        break;
      case URI:
        jj_consume_token(URI);
        break;
      case UNICODERANGE:
        jj_consume_token(UNICODERANGE);
        break;
      case RGB:
        rgb();
        break;
      case HASH:
        hexcolor();
        break;
      case DIMEN:
        jj_consume_token(DIMEN);
        break;
      case INHERIT:
        jj_consume_token(INHERIT);
        break;
      default:
        jj_la1[144] = jj_gen;
        jj_consume_token(-1);
        throw new ParseException();
      }
      label_56:
      while (true) {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case S:
        case COMMENT:
          ;
          break;
        default:
          jj_la1[145] = jj_gen;
          break label_56;
        }
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case S:
          jj_consume_token(S);
          break;
        case COMMENT:
          jj_consume_token(COMMENT);
          break;
        default:
          jj_la1[146] = jj_gen;
          jj_consume_token(-1);
          throw new ParseException();
        }
      }
    } catch (Throwable jjte000) {
      if (jjtc000) {
        jjtree.clearNodeScope(jjtn000);
        jjtc000 = false;
      } else {
        jjtree.popNode();
      }
      if (jjte000 instanceof RuntimeException) {
        {if (true) throw (RuntimeException)jjte000;}
      }
      if (jjte000 instanceof ParseException) {
        {if (true) throw (ParseException)jjte000;}
      }
      {if (true) throw (Error)jjte000;}
    } finally {
      if (jjtc000) {
        jjtree.closeNodeScope(jjtn000, true);
        jjtn000.jjtSetLastToken(getToken(0));
      }
    }
  }

//
// function
//   : FUNCTION S* expr ')' S*
//   ;
//
  final public void function() throws ParseException {
 /*@bgen(jjtree) function */
  SimpleNode jjtn000 = new SimpleNode(JJTFUNCTION);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
  jjtn000.jjtSetFirstToken(getToken(1));
    try {
      jj_consume_token(FUNCTION);
      label_57:
      while (true) {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case S:
        case COMMENT:
          ;
          break;
        default:
          jj_la1[147] = jj_gen;
          break label_57;
        }
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case S:
          jj_consume_token(S);
          break;
        case COMMENT:
          jj_consume_token(COMMENT);
          break;
        default:
          jj_la1[148] = jj_gen;
          jj_consume_token(-1);
          throw new ParseException();
        }
      }
      expr();
      jj_consume_token(RROUND);
    } catch (Throwable jjte000) {
      if (jjtc000) {
        jjtree.clearNodeScope(jjtn000);
        jjtc000 = false;
      } else {
        jjtree.popNode();
      }
      if (jjte000 instanceof RuntimeException) {
        {if (true) throw (RuntimeException)jjte000;}
      }
      if (jjte000 instanceof ParseException) {
        {if (true) throw (ParseException)jjte000;}
      }
      {if (true) throw (Error)jjte000;}
    } finally {
      if (jjtc000) {
        jjtree.closeNodeScope(jjtn000, true);
        jjtn000.jjtSetLastToken(getToken(0));
      }
    }
  }

//
// rgb
//   : RGB S* expr ')' S*
//   ;
//
  final public void rgb() throws ParseException {
 /*@bgen(jjtree) rgb */
  SimpleNode jjtn000 = new SimpleNode(JJTRGB);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
  jjtn000.jjtSetFirstToken(getToken(1));
    try {
      jj_consume_token(RGB);
      label_58:
      while (true) {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case S:
        case COMMENT:
          ;
          break;
        default:
          jj_la1[149] = jj_gen;
          break label_58;
        }
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case S:
          jj_consume_token(S);
          break;
        case COMMENT:
          jj_consume_token(COMMENT);
          break;
        default:
          jj_la1[150] = jj_gen;
          jj_consume_token(-1);
          throw new ParseException();
        }
      }
      expr();
      jj_consume_token(RROUND);
    } catch (Throwable jjte000) {
      if (jjtc000) {
        jjtree.clearNodeScope(jjtn000);
        jjtc000 = false;
      } else {
        jjtree.popNode();
      }
      if (jjte000 instanceof RuntimeException) {
        {if (true) throw (RuntimeException)jjte000;}
      }
      if (jjte000 instanceof ParseException) {
        {if (true) throw (ParseException)jjte000;}
      }
      {if (true) throw (Error)jjte000;}
    } finally {
      if (jjtc000) {
        jjtree.closeNodeScope(jjtn000, true);
        jjtn000.jjtSetLastToken(getToken(0));
      }
    }
  }

//
// hexcolor
//   : HASH S*
//   ;
//
  final public void hexcolor() throws ParseException {
 /*@bgen(jjtree) hexcolor */
  SimpleNode jjtn000 = new SimpleNode(JJTHEXCOLOR);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
  jjtn000.jjtSetFirstToken(getToken(1));
    try {
      jj_consume_token(HASH);
      label_59:
      while (true) {
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case S:
        case COMMENT:
          ;
          break;
        default:
          jj_la1[151] = jj_gen;
          break label_59;
        }
        switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
        case S:
          jj_consume_token(S);
          break;
        case COMMENT:
          jj_consume_token(COMMENT);
          break;
        default:
          jj_la1[152] = jj_gen;
          jj_consume_token(-1);
          throw new ParseException();
        }
      }
    } finally {
      if (jjtc000) {
        jjtree.closeNodeScope(jjtn000, true);
        jjtn000.jjtSetLastToken(getToken(0));
      }
    }
  }

  void reportError(ParseException pe) throws ParseException {
                                     /*@bgen(jjtree) reportError */
 SimpleNode jjtn000 = new SimpleNode(JJTREPORTERROR);
 boolean jjtc000 = true;
 jjtree.openNodeScope(jjtn000);
 jjtn000.jjtSetFirstToken(getToken(1));
 try {errors.add(pe);/*@bgen(jjtree)*/
 } finally {
   if (jjtc000) {
     jjtree.closeNodeScope(jjtn000, true);
     jjtn000.jjtSetLastToken(getToken(0));
   }
 }
  }

  void skipSelector() throws ParseException {
                     /*@bgen(jjtree) skipSelector */
 SimpleNode jjtn000 = new SimpleNode(JJTSKIPSELECTOR);
 boolean jjtc000 = true;
 jjtree.openNodeScope(jjtn000);
 jjtn000.jjtSetFirstToken(getToken(1));
 try {Token t = getToken(1);
    while (t.kind != COMMA && t.kind != SEMICOLON && t.kind != LBRACE && t.kind != EOF ) {
        getNextToken();
        t = getToken(1);
    }/*@bgen(jjtree)*/
 } finally {
   if (jjtc000) {
     jjtree.closeNodeScope(jjtn000, true);
     jjtn000.jjtSetLastToken(getToken(0));
   }
 }
  }

  String skip() throws ParseException {
               /*@bgen(jjtree) skip */
SimpleNode jjtn000 = new SimpleNode(JJTSKIP);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtn000.jjtSetFirstToken(getToken(1));
try {StringBuffer sb = new StringBuffer();
  int nesting = 0;
  Token t = getToken(0);
  if (t.image != null) {
    sb.append(t.image);
  }
  do {
    t = getNextToken();
    if (t.kind == EOF)
      break;
    sb.append(t.image);
    if (t.kind == LBRACE)
      nesting++;
    else if (t.kind == RBRACE)
      nesting--;
    else if (t.kind == SEMICOLON && nesting <= 0)
      break;
  }
  while ((t.kind != RBRACE) || (nesting > 0));

  return sb.toString();/*@bgen(jjtree)*/
} finally {
  if (jjtc000) {
    jjtree.closeNodeScope(jjtn000, true);
    jjtn000.jjtSetLastToken(getToken(0));
  }
}
  }

  void error_skipblock() throws ParseException {
                        /*@bgen(jjtree) error_skipblock */
 SimpleNode jjtn000 = new SimpleNode(JJTERROR_SKIPBLOCK);
 boolean jjtc000 = true;
 jjtree.openNodeScope(jjtn000);
 jjtn000.jjtSetFirstToken(getToken(1));
 try {ParseException e = generateParseException();
    //System.err.println( "** error_skipblock **\n" + e.toString() );

  Token t = getToken(0);
  int nesting = 0;
  while ((t.kind != RBRACE) || (nesting > 0)) {
    t = getNextToken();
    if( t.kind == LBRACE )
      nesting++;
    else if( t.kind == RBRACE )
      nesting--;
    else if( t.kind == EOF )
      break;
  }/*@bgen(jjtree)*/
 } finally {
   if (jjtc000) {
     jjtree.closeNodeScope(jjtn000, true);
     jjtn000.jjtSetLastToken(getToken(0));
   }
 }
  }

  void error_skipdecl() throws ParseException {
                       /*@bgen(jjtree) error_skipdecl */
 SimpleNode jjtn000 = new SimpleNode(JJTERROR_SKIPDECL);
 boolean jjtc000 = true;
 jjtree.openNodeScope(jjtn000);
 jjtn000.jjtSetFirstToken(getToken(1));
 try {ParseException e = generateParseException();
    //System.err.println("** error_skipdecl **\n" + e.toString());

  Token t = getNextToken();
  while (t.kind != SEMICOLON && t.kind != RBRACE && t.kind != EOF ) {
      getNextToken();
      t = getToken(1);
  }/*@bgen(jjtree)*/
 } finally {
   if (jjtc000) {
     jjtree.closeNodeScope(jjtn000, true);
     jjtn000.jjtSetLastToken(getToken(0));
   }
 }
  }

  void error_skip_to_whitespace() throws ParseException {
                                 /*@bgen(jjtree) error_skip_to_whitespace */
SimpleNode jjtn000 = new SimpleNode(JJTERROR_SKIP_TO_WHITESPACE);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtn000.jjtSetFirstToken(getToken(1));
try {Token t;
  do {
    t = getNextToken();
  } while (t != null && t.kind != S &&  t.kind != EOF );/*@bgen(jjtree)*/
} finally {
  if (jjtc000) {
    jjtree.closeNodeScope(jjtn000, true);
    jjtn000.jjtSetLastToken(getToken(0));
  }
}
  }

  private boolean jj_2_1(int xla) {
    jj_la = xla; jj_lastpos = jj_scanpos = token;
    try { return !jj_3_1(); }
    catch(LookaheadSuccess ls) { return true; }
    finally { jj_save(0, xla); }
  }

  private boolean jj_2_2(int xla) {
    jj_la = xla; jj_lastpos = jj_scanpos = token;
    try { return !jj_3_2(); }
    catch(LookaheadSuccess ls) { return true; }
    finally { jj_save(1, xla); }
  }

  private boolean jj_2_3(int xla) {
    jj_la = xla; jj_lastpos = jj_scanpos = token;
    try { return !jj_3_3(); }
    catch(LookaheadSuccess ls) { return true; }
    finally { jj_save(2, xla); }
  }

  private boolean jj_3_1() {
    if (jj_scan_token(IDENT)) return true;
    Token xsp;
    while (true) {
      xsp = jj_scanpos;
      if (jj_3R_60()) { jj_scanpos = xsp; break; }
    }
    return false;
  }

  private boolean jj_3R_72() {
    Token xsp;
    xsp = jj_scanpos;
    if (jj_scan_token(63)) {
    jj_scanpos = xsp;
    if (jj_scan_token(27)) {
    jj_scanpos = xsp;
    if (jj_scan_token(14)) return true;
    }
    }
    return false;
  }

  private boolean jj_3_2() {
    if (jj_3R_61()) return true;
    if (jj_3R_62()) return true;
    return false;
  }

  private boolean jj_3R_79() {
    if (jj_scan_token(DOT)) return true;
    return false;
  }

  private boolean jj_3R_71() {
    Token xsp;
    xsp = jj_scanpos;
    if (jj_scan_token(16)) {
    jj_scanpos = xsp;
    if (jj_scan_token(19)) return true;
    }
    return false;
  }

  private boolean jj_3R_77() {
    if (jj_3R_81()) return true;
    return false;
  }

  private boolean jj_3R_76() {
    if (jj_3R_80()) return true;
    return false;
  }

  private boolean jj_3R_75() {
    if (jj_3R_79()) return true;
    return false;
  }

  private boolean jj_3R_60() {
    Token xsp;
    xsp = jj_scanpos;
    if (jj_scan_token(1)) {
    jj_scanpos = xsp;
    if (jj_scan_token(4)) return true;
    }
    return false;
  }

  private boolean jj_3R_74() {
    if (jj_3R_78()) return true;
    return false;
  }

  private boolean jj_3R_73() {
    Token xsp;
    xsp = jj_scanpos;
    if (jj_3R_74()) {
    jj_scanpos = xsp;
    if (jj_3R_75()) {
    jj_scanpos = xsp;
    if (jj_3R_76()) {
    jj_scanpos = xsp;
    if (jj_3R_77()) return true;
    }
    }
    }
    return false;
  }

  private boolean jj_3R_63() {
    Token xsp;
    xsp = jj_scanpos;
    if (jj_scan_token(1)) {
    jj_scanpos = xsp;
    if (jj_scan_token(4)) return true;
    }
    return false;
  }

  private boolean jj_3R_78() {
    if (jj_scan_token(HASH)) return true;
    return false;
  }

  private boolean jj_3R_68() {
    Token xsp;
    if (jj_3R_73()) return true;
    while (true) {
      xsp = jj_scanpos;
      if (jj_3R_73()) { jj_scanpos = xsp; break; }
    }
    return false;
  }

  private boolean jj_3R_69() {
    Token xsp;
    xsp = jj_scanpos;
    if (jj_scan_token(1)) {
    jj_scanpos = xsp;
    if (jj_scan_token(4)) return true;
    }
    return false;
  }

  private boolean jj_3R_70() {
    Token xsp;
    xsp = jj_scanpos;
    if (jj_scan_token(1)) {
    jj_scanpos = xsp;
    if (jj_scan_token(4)) return true;
    }
    return false;
  }

  private boolean jj_3R_80() {
    if (jj_scan_token(LSQUARE)) return true;
    return false;
  }

  private boolean jj_3_3() {
    if (jj_scan_token(GENERATED)) return true;
    Token xsp;
    while (true) {
      xsp = jj_scanpos;
      if (jj_3R_63()) { jj_scanpos = xsp; break; }
    }
    xsp = jj_scanpos;
    if (jj_scan_token(12)) {
    jj_scanpos = xsp;
    if (jj_scan_token(9)) return true;
    }
    return false;
  }

  private boolean jj_3R_67() {
    if (jj_3R_72()) return true;
    return false;
  }

  private boolean jj_3R_66() {
    Token xsp;
    xsp = jj_scanpos;
    if (jj_scan_token(1)) {
    jj_scanpos = xsp;
    if (jj_scan_token(4)) return true;
    }
    xsp = jj_scanpos;
    if (jj_3R_71()) jj_scanpos = xsp;
    return false;
  }

  private boolean jj_3R_65() {
    if (jj_scan_token(GT)) return true;
    Token xsp;
    while (true) {
      xsp = jj_scanpos;
      if (jj_3R_70()) { jj_scanpos = xsp; break; }
    }
    return false;
  }

  private boolean jj_3R_64() {
    if (jj_scan_token(PLUS)) return true;
    Token xsp;
    while (true) {
      xsp = jj_scanpos;
      if (jj_3R_69()) { jj_scanpos = xsp; break; }
    }
    return false;
  }

  private boolean jj_3R_62() {
    Token xsp;
    xsp = jj_scanpos;
    if (jj_3R_67()) {
    jj_scanpos = xsp;
    if (jj_3R_68()) return true;
    }
    return false;
  }

  private boolean jj_3R_61() {
    Token xsp;
    xsp = jj_scanpos;
    if (jj_3R_64()) {
    jj_scanpos = xsp;
    if (jj_3R_65()) {
    jj_scanpos = xsp;
    if (jj_3R_66()) return true;
    }
    }
    return false;
  }

  private boolean jj_3R_81() {
    if (jj_scan_token(COLON)) return true;
    return false;
  }

  /** Generated Token Manager. */
  public CssParserTokenManager token_source;
  /** Current token. */
  public Token token;
  /** Next token. */
  public Token jj_nt;
  private int jj_ntk;
  private Token jj_scanpos, jj_lastpos;
  private int jj_la;
  private int jj_gen;
  final private int[] jj_la1 = new int[153];
  static private int[] jj_la1_0;
  static private int[] jj_la1_1;
  static private int[] jj_la1_2;
  static {
      jj_la1_init_0();
      jj_la1_init_1();
      jj_la1_init_2();
   }
   private static void jj_la1_init_0() {
      jj_la1_0 = new int[] {0x0,0x30000012,0x12,0x30000012,0x0,0x30000012,0x12,0x30000012,0x1,0x30000012,0x12,0x30000012,0x8506800,0x8506800,0x12,0x12,0x12,0x12,0x12,0x12,0x4800000,0x12,0x12,0x8000000,0x12,0x12,0x12,0x12,0x8506800,0x400,0x12,0x12,0x8506800,0x12,0x12,0x8506800,0x8506800,0x8000000,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x2000,0x2000,0x12,0x12,0x8400000,0x1000,0x12,0x12,0x8400000,0x12,0x12,0x12,0x12,0x8400000,0x1000,0x12,0x12,0x8400000,0x12,0x12,0x12,0x12,0x8400,0x12,0x12,0x12,0x12,0x12,0x90000,0x12,0x12,0x90000,0x90012,0x30000,0x8400000,0x12,0x12,0x12,0x12,0x8400000,0x1000,0x12,0x12,0x8400000,0x400,0x12,0x12,0x12,0x12,0x502800,0x502800,0x502800,0x502800,0x8506800,0x8000000,0x8004000,0x12,0x12,0x12,0x12,0xc0040000,0x12,0x12,0x800000,0x12,0x12,0xc0040000,0x8000000,0x12,0x12,0x800,0x8000800,0x12,0x12,0x8000000,0x12,0x12,0x8400000,0x1000,0x12,0x12,0x8400000,0x12,0x12,0x12,0x12,0x0,0x8400000,0x12,0x12,0xcc7ac40,0x48400,0x48400,0xcc32840,0x30000,0x40,0xcc00040,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,};
   }
   private static void jj_la1_init_1() {
      jj_la1_1 = new int[] {0x80,0x0,0x0,0x0,0x8,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x80000170,0x800001f8,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x80000000,0x0,0x0,0x0,0x0,0x80000110,0x0,0x0,0x0,0x80000110,0x0,0x0,0x80000110,0x80000110,0x80000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x80000000,0x80000000,0x0,0x0,0x80000000,0x0,0x0,0x0,0x80000000,0x0,0x0,0x0,0x0,0x80000000,0x0,0x0,0x0,0x80000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x80000000,0x0,0x0,0x0,0x0,0x80000000,0x0,0x0,0x0,0x80000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x80000000,0x80000000,0x80000000,0x0,0x0,0x0,0x0,0x7,0x0,0x0,0x80000000,0x0,0x0,0x7,0x80000000,0x0,0x0,0x0,0x80000000,0x0,0x0,0xc0000000,0x0,0x0,0x80000000,0x0,0x0,0x0,0x80000000,0x0,0x0,0x0,0x0,0x200,0x80000000,0x0,0x0,0xfffffc00,0x0,0x0,0xfffffc00,0x0,0x5bfff800,0xfffffc00,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,};
   }
   private static void jj_la1_init_2() {
      jj_la1_2 = new int[] {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x4,0x0,0x0,0x4,0x0,0x0,0x4,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,};
   }
  final private JJCalls[] jj_2_rtns = new JJCalls[3];
  private boolean jj_rescan = false;
  private int jj_gc = 0;

  /** Constructor with user supplied CharStream. */
  public CssParser(CharStream stream) {
    token_source = new CssParserTokenManager(stream);
    token = new Token();
    jj_ntk = -1;
    jj_gen = 0;
    for (int i = 0; i < 153; i++) jj_la1[i] = -1;
    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
  }

  /** Reinitialise. */
  public void ReInit(CharStream stream) {
    token_source.ReInit(stream);
    token = new Token();
    jj_ntk = -1;
    jjtree.reset();
    jj_gen = 0;
    for (int i = 0; i < 153; i++) jj_la1[i] = -1;
    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
  }

  /** Constructor with generated Token Manager. */
  public CssParser(CssParserTokenManager tm) {
    token_source = tm;
    token = new Token();
    jj_ntk = -1;
    jj_gen = 0;
    for (int i = 0; i < 153; i++) jj_la1[i] = -1;
    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
  }

  /** Reinitialise. */
  public void ReInit(CssParserTokenManager tm) {
    token_source = tm;
    token = new Token();
    jj_ntk = -1;
    jjtree.reset();
    jj_gen = 0;
    for (int i = 0; i < 153; i++) jj_la1[i] = -1;
    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
  }

  private Token jj_consume_token(int kind) throws ParseException {
    Token oldToken;
    if ((oldToken = token).next != null) token = token.next;
    else token = token.next = token_source.getNextToken();
    jj_ntk = -1;
    if (token.kind == kind) {
      jj_gen++;
      if (++jj_gc > 100) {
        jj_gc = 0;
        for (int i = 0; i < jj_2_rtns.length; i++) {
          JJCalls c = jj_2_rtns[i];
          while (c != null) {
            if (c.gen < jj_gen) c.first = null;
            c = c.next;
          }
        }
      }
      return token;
    }
    token = oldToken;
    jj_kind = kind;
    throw generateParseException();
  }

  static private final class LookaheadSuccess extends java.lang.Error { }
  final private LookaheadSuccess jj_ls = new LookaheadSuccess();
  private boolean jj_scan_token(int kind) {
    if (jj_scanpos == jj_lastpos) {
      jj_la--;
      if (jj_scanpos.next == null) {
        jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken();
      } else {
        jj_lastpos = jj_scanpos = jj_scanpos.next;
      }
    } else {
      jj_scanpos = jj_scanpos.next;
    }
    if (jj_rescan) {
      int i = 0; Token tok = token;
      while (tok != null && tok != jj_scanpos) { i++; tok = tok.next; }
      if (tok != null) jj_add_error_token(kind, i);
    }
    if (jj_scanpos.kind != kind) return true;
    if (jj_la == 0 && jj_scanpos == jj_lastpos) throw jj_ls;
    return false;
  }


/** Get the next Token. */
  final public Token getNextToken() {
    if (token.next != null) token = token.next;
    else token = token.next = token_source.getNextToken();
    jj_ntk = -1;
    jj_gen++;
    return token;
  }

/** Get the specific Token. */
  final public Token getToken(int index) {
    Token t = token;
    for (int i = 0; i < index; i++) {
      if (t.next != null) t = t.next;
      else t = t.next = token_source.getNextToken();
    }
    return t;
  }

  private int jj_ntk() {
    if ((jj_nt=token.next) == null)
      return (jj_ntk = (token.next=token_source.getNextToken()).kind);
    else
      return (jj_ntk = jj_nt.kind);
  }

  private java.util.List jj_expentries = new java.util.ArrayList();
  private int[] jj_expentry;
  private int jj_kind = -1;
  private int[] jj_lasttokens = new int[100];
  private int jj_endpos;

  private void jj_add_error_token(int kind, int pos) {
    if (pos >= 100) return;
    if (pos == jj_endpos + 1) {
      jj_lasttokens[jj_endpos++] = kind;
    } else if (jj_endpos != 0) {
      jj_expentry = new int[jj_endpos];
      for (int i = 0; i < jj_endpos; i++) {
        jj_expentry[i] = jj_lasttokens[i];
      }
      jj_entries_loop: for (java.util.Iterator it = jj_expentries.iterator(); it.hasNext();) {
        int[] oldentry = (int[])(it.next());
        if (oldentry.length == jj_expentry.length) {
          for (int i = 0; i < jj_expentry.length; i++) {
            if (oldentry[i] != jj_expentry[i]) {
              continue jj_entries_loop;
            }
          }
          jj_expentries.add(jj_expentry);
          break jj_entries_loop;
        }
      }
      if (pos != 0) jj_lasttokens[(jj_endpos = pos) - 1] = kind;
    }
  }

  /** Generate ParseException. */
  public ParseException generateParseException() {
    jj_expentries.clear();
    boolean[] la1tokens = new boolean[85];
    if (jj_kind >= 0) {
      la1tokens[jj_kind] = true;
      jj_kind = -1;
    }
    for (int i = 0; i < 153; i++) {
      if (jj_la1[i] == jj_gen) {
        for (int j = 0; j < 32; j++) {
          if ((jj_la1_0[i] & (1< jj_gen) {
          jj_la = p.arg; jj_lastpos = jj_scanpos = p.first;
          switch (i) {
            case 0: jj_3_1(); break;
            case 1: jj_3_2(); break;
            case 2: jj_3_3(); break;
          }
        }
        p = p.next;
      } while (p != null);
      } catch(LookaheadSuccess ls) { }
    }
    jj_rescan = false;
  }

  private void jj_save(int index, int xla) {
    JJCalls p = jj_2_rtns[index];
    while (p.gen > jj_gen) {
      if (p.next == null) { p = p.next = new JJCalls(); break; }
      p = p.next;
    }
    p.gen = jj_gen + xla - jj_la; p.first = token; p.arg = xla;
  }

  static final class JJCalls {
    int gen;
    Token first;
    int arg;
    JJCalls next;
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy