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

at.newmedialab.ldpath.parser.RdfPathParser Maven / Gradle / Ivy

/* Generated By:JavaCC: Do not edit this line. RdfPathParser.java */
package at.newmedialab.ldpath.parser;

import at.newmedialab.ldpath.model.Constants;

import at.newmedialab.ldpath.api.backend.*;
import at.newmedialab.ldpath.api.functions.*;
import at.newmedialab.ldpath.api.selectors.*;
import at.newmedialab.ldpath.api.tests.*;
import at.newmedialab.ldpath.api.transformers.*;


import at.newmedialab.ldpath.model.fields.*;
import at.newmedialab.ldpath.model.functions.*;
import at.newmedialab.ldpath.model.programs.*;
import at.newmedialab.ldpath.model.selectors.*;
import at.newmedialab.ldpath.model.tests.*;
import at.newmedialab.ldpath.model.transformers.*;


import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import java.util.Locale;
import java.util.Collections;

import java.io.Reader;
import java.io.InputStream;

import java.net.URI;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


@SuppressWarnings("all")
public class RdfPathParser implements RdfPathParserConstants {

        private enum Mode { RULE, SELECTOR, PROGRAM };


        private static final Logger log = LoggerFactory.getLogger(RdfPathParser.class);

        /**
         * A map mapping from namespace prefix to namespace URI
         */
        private Map namespaces = new HashMap();

        private RDFBackend backend;

        private Configuration config;

        private Mode mode = Mode.PROGRAM;

        public RdfPathParser(RDFBackend backend, Reader in) {
            this(backend,null,in);
        }

        public RdfPathParser(RDFBackend backend, Configuration config, Reader in) {
            this(in);
            this.backend = backend;
            if(config == null) {
                this.config = new DefaultConfiguration();
            } else {
                this.config = config;
            }

            initialise();
        }

        public RdfPathParser(RDFBackend backend, InputStream in) {
            this(backend,null,in);
        }

        public RdfPathParser(RDFBackend backend, Configuration config, InputStream in) {
            this(in);
            this.backend = backend;
            if(config == null) {
                this.config = new DefaultConfiguration();
            } else {
                this.config = config;
            }

            initialise();
        }

        public RdfPathParser(RDFBackend backend, InputStream in, String encoding) {
            this(backend,null,in,encoding);
        }

        public RdfPathParser(RDFBackend backend, Configuration config, InputStream in, String encoding) {
            this(in,encoding);
            this.backend = backend;
            if(config == null) {
                this.config = new DefaultConfiguration();
            } else {
                this.config = config;
            }

            initialise();
        }

        public Program parseProgram() throws ParseException {
                        namespaces.clear();
                        namespaces.putAll(config.getNamespaces());

            mode = Mode.PROGRAM;
            try {
                        return Program();
                    } catch(TokenMgrError error){
                        throw new ParseException("Unable to parse Program: (Message: "+error.getMessage()+")");
                    }
        }

        public NodeSelector parseSelector(Map ctxNamespaces) throws ParseException {
                        namespaces.clear();
                        namespaces.putAll(config.getNamespaces());
                        if(ctxNamespaces != null) {
                            namespaces.putAll(ctxNamespaces);
                        }

                        mode = Mode.SELECTOR;

            try {
                    return Selector();
            } catch(TokenMgrError error){
                throw new ParseException("Unable to parse Selector: (Message: "+error.getMessage()+")");
            }
        }

        public  FieldMapping parseRule(Map ctxNamespaces) throws ParseException {
                        namespaces.clear();
                        namespaces.putAll(config.getNamespaces());
                        if(ctxNamespaces != null) {
                            namespaces.putAll(ctxNamespaces);
                        }

                        mode = Mode.RULE;

            try {
                    return Rule();
            } catch(TokenMgrError error){
                throw new ParseException("Unable to parse Rule: (Message: "+error.getMessage()+")");
            }
        }


        public Node resolveResource(String uri) {
            return backend.createURI(uri);
        }


        public String resolveNamespace(String prefix) throws ParseException {
            String uri = namespaces.get(prefix);
            if(uri == null) {
                throw new ParseException("Namespace "+prefix+" not defined!");
            }
            return uri;
        }


        public SelectorFunction getFunction(String uri) throws ParseException {
            if(xsdNodeFunctionMap.get(uri) != null) {
               return xsdNodeFunctionMap.get(uri);
            } else {
                throw new ParseException("function with URI "+uri+"does not exist");
            }
        }


        public NodeTransformer getTransformer(String uri) throws ParseException {
            if(xsdNodeTransformerMap.get(uri) != null) {
                return xsdNodeTransformerMap.get(uri);
            } else {
                throw new ParseException("transformer with URI "+uri+"does not exist");
            }
        }


        private void initialise() {
            initTransformerMappings();
            initFunctionMappings();
        }

        /**
         * Register the function passed as argument in this parser's function map.
         */
        public void registerFunction(SelectorFunction function) {
            registerFunction(xsdNodeFunctionMap,function);
        }

        /**
         * Register the result transformer passed as argument for the given type uri.
         */
        public void registerTransformer(String typeUri, NodeTransformer transformer) {
            xsdNodeTransformerMap.put(typeUri,transformer);
        }


        /**
         * A map mapping from XSD types to node transformers.
         */
        private Map> xsdNodeTransformerMap;
        private void initTransformerMappings() {
            Map> transformerMap = new HashMap>();

            transformerMap.putAll(config.getTransformers());

            xsdNodeTransformerMap = transformerMap;
        }


        private Map> xsdNodeFunctionMap;
        private void initFunctionMappings() {
            Map> functionMap = new HashMap>();

            functionMap.putAll(config.getFunctions());

            xsdNodeFunctionMap = functionMap;
        }

        private void registerFunction(Map> register, final SelectorFunction function) {
            register.put(Constants.NS_LMF_FUNCS + function.getPathExpression(backend), function);
        }

  final public Program Program() throws ParseException {
    Program program = new Program();
    NodeTest filter = null;
    FieldMapping rule;
    Token prefix = null;
    Token uri;
    NodeSelector boostSelector;
    label_1:
    while (true) {
      if (jj_2_1(2147483647)) {
        ;
      } else {
        break label_1;
      }
      jj_consume_token(15);
      prefix = jj_consume_token(IDENTIFIER);
      jj_consume_token(16);
      jj_consume_token(17);
      uri = jj_consume_token(URI);
      jj_consume_token(18);
      jj_consume_token(19);
        program.addNamespace(prefix.image, uri.image );
        namespaces.put(prefix.image,uri.image);
    }
    if (jj_2_2(2147483647)) {
      jj_consume_token(20);
      filter = NodeTest();
      jj_consume_token(19);
        program.setFilter(filter);
    } else {
      ;
    }
    if (jj_2_3(2147483647)) {
      jj_consume_token(21);
      boostSelector = Selector();
      jj_consume_token(19);
        NodeTransformer transformer = getTransformer(Program.DOCUMENT_BOOST_TYPE);
                FieldMapping booster = new FieldMapping("@boost", Program.DOCUMENT_BOOST_TYPE, boostSelector, transformer, null);
                program.setBooster(booster);
    } else {
      ;
    }
    label_2:
    while (true) {
      if (jj_2_4(2147483647)) {
        ;
      } else {
        break label_2;
      }
      rule = Rule();
       program.addMapping(rule);
    }
    jj_consume_token(0);
    {if (true) return program;}
    throw new Error("Missing return statement in function");
  }

  final public FieldMapping Rule() throws ParseException {
    FieldMapping rule;
    Token name;
    String uri;
    String type = null;
    NodeSelector selector;
    NodeTransformer transformer;
    Map conf = null;
    if (jj_2_12(2147483647)) {
      name = jj_consume_token(IDENTIFIER);
      jj_consume_token(22);
      selector = Selector();
      if (jj_2_5(2147483647)) {
        jj_consume_token(23);
        type = Uri();
      } else {
        ;
      }
      if (jj_2_6(2147483647)) {
        jj_consume_token(24);
        conf = FieldConfig();
        jj_consume_token(25);
      } else {
        ;
      }
      jj_consume_token(19);
        if(type != null) {
            transformer = getTransformer(type);
        } else {
            transformer = new IdentityTransformer();
        }
        if(mode != Mode.PROGRAM) {
            {if (true) throw new ParseException("cannot use field names when parsing single paths");}
        }
        rule = new FieldMapping(name.image,type,selector,transformer, conf);
        {if (true) return rule;}
    } else if (jj_2_13(2147483647)) {
      uri = Uri();
      jj_consume_token(22);
      selector = Selector();
      if (jj_2_7(2147483647)) {
        jj_consume_token(23);
        type = Uri();
      } else {
        ;
      }
      if (jj_2_8(2147483647)) {
        jj_consume_token(24);
        conf = FieldConfig();
        jj_consume_token(25);
      } else {
        ;
      }
      jj_consume_token(19);
        if(type != null) {
            transformer = getTransformer(type);
        } else {
            transformer = new IdentityTransformer();
        }
        if(mode != Mode.PROGRAM) {
            {if (true) throw new ParseException("cannot use field names when parsing single paths");}
        }
        rule = new FieldMapping(uri,type,selector,transformer, conf);
        {if (true) return rule;}
    } else if (jj_2_14(2147483647)) {
      selector = Selector();
      if (jj_2_9(2147483647)) {
        jj_consume_token(23);
        type = Uri();
      } else {
        ;
      }
      if (jj_2_10(2147483647)) {
        jj_consume_token(24);
        conf = FieldConfig();
        jj_consume_token(25);
      } else {
        ;
      }
      if (jj_2_11(2147483647)) {
        jj_consume_token(19);
      } else {
        ;
      }
        if(type != null) {
            transformer = getTransformer(type);
        } else {
            transformer = new IdentityTransformer();
        }
        if(mode != Mode.PROGRAM && conf != null) {
            {if (true) throw new ParseException("cannot use configuration parameters when parsing single paths");}
        }
        try {
            rule = new FieldMapping(selector.getName(backend),type,selector,transformer, conf);
        } catch(UnsupportedOperationException ex) {
            if(mode == Mode.PROGRAM) {
                rule = new FieldMapping("unnamed",type,selector,transformer, conf);
                log.error("error while parsing {}: {}", rule.getPathExpression(backend),ex.getMessage());
                {if (true) throw new ParseException("error while parsing "+rule.getPathExpression(backend)+": "+ex.getMessage());}
            } else {
                rule = new FieldMapping("unnamed",type,selector,transformer, conf);
            }
        }
        {if (true) return rule;}
    } else {
      jj_consume_token(-1);
      throw new ParseException();
    }
    throw new Error("Missing return statement in function");
  }

  final public Map FieldConfig() throws ParseException {
        Map conf = new HashMap();
        Token key = null;
        String val = null;
        Map more = null;
    if (jj_2_16(2147483647)) {
      key = jj_consume_token(IDENTIFIER);
      jj_consume_token(22);
      val = ConfVal();
      if (jj_2_15(2147483647)) {
        jj_consume_token(26);
        more = FieldConfig();
      } else {
        ;
      }
    } else {
      ;
    }
                if (key == null || val == null) {if (true) return null;}
                conf.put(key.image, val);
                if (more != null) {
                        conf.putAll(more);
                }
                {if (true) return conf;}
    throw new Error("Missing return statement in function");
  }

  final public String ConfVal() throws ParseException {
        Token str, id;
    if (jj_2_17(2147483647)) {
      str = jj_consume_token(STRLIT);
                         {if (true) return str.image.substring(1, str.image.length() -1);}
    } else if (jj_2_18(2147483647)) {
      id = jj_consume_token(IDENTIFIER);
                            {if (true) return id.image;}
    } else {
      jj_consume_token(-1);
      throw new ParseException();
    }
    throw new Error("Missing return statement in function");
  }

  final public String Uri() throws ParseException {
    Token uri, prefix, localName;
    if (jj_2_19(2147483647)) {
      jj_consume_token(17);
      uri = jj_consume_token(URI);
      jj_consume_token(18);
       {if (true) return uri.image;}
    } else if (jj_2_20(2147483647)) {
      prefix = jj_consume_token(IDENTIFIER);
      jj_consume_token(16);
      localName = jj_consume_token(IDENTIFIER);
        {if (true) return resolveNamespace(prefix.image)+localName.image;}
    } else {
      jj_consume_token(-1);
      throw new ParseException();
    }
    throw new Error("Missing return statement in function");
  }

  final public NodeSelector Selector() throws ParseException {
    NodeSelector result;
    if (jj_2_21(2147483647)) {
      result = CompoundSelector();
    } else if (jj_2_22(2147483647)) {
      result = TestingSelector();
    } else if (jj_2_23(2147483647)) {
      result = AtomicSelector();
    } else {
      jj_consume_token(-1);
      throw new ParseException();
    }
        {if (true) return result;}
    throw new Error("Missing return statement in function");
  }

  final public NodeSelector CompoundSelector() throws ParseException {
    NodeSelector result = null;
    if (jj_2_24(2147483647)) {
      /* Union Selector */
              result = UnionSelector();
    } else if (jj_2_25(2147483647)) {
      /* Intersection Selector */
              result = IntersectionSelector();
    } else if (jj_2_26(2147483647)) {
      /* Path Selector */
              result = PathSelector();
    } else {
      jj_consume_token(-1);
      throw new ParseException();
    }
        {if (true) return result;}
    throw new Error("Missing return statement in function");
  }

/**
 * As path elements, we do not allow arbitrary compound selectors, but we allow all atomic and path selectors.
 */
  final public NodeSelector AtomicOrTestingOrPathSelector() throws ParseException {
    NodeSelector result = null;
    if (jj_2_27(2147483647)) {
      /* Path Selector */
              result = PathSelector();
    } else if (jj_2_28(2147483647)) {
      /* Atomic Selector */
              result = AtomicOrTestingSelector();
    } else {
      jj_consume_token(-1);
      throw new ParseException();
    }
        {if (true) return result;}
    throw new Error("Missing return statement in function");
  }

  final public NodeSelector AtomicOrTestingSelector() throws ParseException {
    NodeSelector result = null;
    if (jj_2_29(2147483647)) {
      /* Testing Selector */
              result = TestingSelector();
    } else if (jj_2_30(2147483647)) {
      /* Atomic Selector */
              result = AtomicSelector();
    } else {
      jj_consume_token(-1);
      throw new ParseException();
    }
        {if (true) return result;}
    throw new Error("Missing return statement in function");
  }

  final public NodeSelector AtomicSelector() throws ParseException {
    NodeSelector result = null;
    if (jj_2_31(2147483647)) {
      /* Self Selector */
              result = SelfSelector();
    } else if (jj_2_32(2147483647)) {
      /* Property Selector */
              result = PropertySelector();
    } else if (jj_2_33(2147483647)) {
      /* Wildcard Selector */
              result = WildcardSelector();
    } else if (jj_2_34(2147483647)) {
      /* Reverse Property Selector */
              result = ReversePropertySelector();
    } else if (jj_2_35(2147483647)) {
      /* Function Selector */
              result = FunctionSelector();
    } else if (jj_2_36(2147483647)) {
      /* String Constant Selector */
              result = StringConstantSelector();
    } else if (jj_2_37(2147483647)) {
      /* Recursive Path Selector */
              result = RecursivePathSelector();
    } else if (jj_2_38(2147483647)) {
      /* Other selector enclosed in braces */
              result = GroupedSelector();
    } else {
      jj_consume_token(-1);
      throw new ParseException();
    }
        {if (true) return result;}
    throw new Error("Missing return statement in function");
  }

  final public NodeSelector SelfSelector() throws ParseException {
    jj_consume_token(27);
              {if (true) return new SelfSelector();}
    throw new Error("Missing return statement in function");
  }

  final public NodeSelector GroupedSelector() throws ParseException {
    NodeSelector result = null;
    jj_consume_token(24);
    result = Selector();
    jj_consume_token(25);
        {if (true) return result;}
    throw new Error("Missing return statement in function");
  }

  final public RecursivePathSelector RecursivePathSelector() throws ParseException {
        RecursivePathSelector result = null;
        NodeSelector delegate        = null;
    if (jj_2_39(2147483647)) {
      jj_consume_token(24);
      delegate = Selector();
      jj_consume_token(25);
      jj_consume_token(28);
                result = RecursivePathSelector.getPathSelectorPlused(delegate);
                {if (true) return result;}
    } else if (jj_2_40(2147483647)) {
      jj_consume_token(24);
      delegate = Selector();
      jj_consume_token(25);
      jj_consume_token(29);
        result = RecursivePathSelector.getPathSelectorStared(delegate);
        {if (true) return result;}
    } else {
      jj_consume_token(-1);
      throw new ParseException();
    }
    throw new Error("Missing return statement in function");
  }

  final public PathSelector PathSelector() throws ParseException {
    PathSelector result = null;
    NodeSelector left   = null;
    NodeSelector right  = null;
    left = AtomicOrTestingSelector();
    jj_consume_token(30);
    right = AtomicOrTestingOrPathSelector();
        result = new PathSelector(left,right);
        {if (true) return result;}
    throw new Error("Missing return statement in function");
  }

  final public IntersectionSelector IntersectionSelector() throws ParseException {
    IntersectionSelector result = null;
    NodeSelector left   = null;
    NodeSelector right  = null;
    left = AtomicOrTestingOrPathSelector();
    jj_consume_token(AND);
    right = Selector();
        result = new IntersectionSelector(left,right);
        {if (true) return result;}
    throw new Error("Missing return statement in function");
  }

  final public UnionSelector UnionSelector() throws ParseException {
    UnionSelector result = null;
    NodeSelector left   = null;
    NodeSelector right  = null;
    left = AtomicOrTestingOrPathSelector();
    jj_consume_token(OR);
    right = Selector();
        result = new UnionSelector(left,right);
        {if (true) return result;}
    throw new Error("Missing return statement in function");
  }

  final public TestingSelector TestingSelector() throws ParseException {
    TestingSelector result = null;
    NodeSelector delegate  = null;
    NodeTest test = null;
    delegate = AtomicSelector();
    jj_consume_token(31);
    test = NodeTest();
    jj_consume_token(32);
        result = new TestingSelector(delegate,test);
        {if (true) return result;}
    throw new Error("Missing return statement in function");
  }

  final public ReversePropertySelector ReversePropertySelector() throws ParseException {
        ReversePropertySelector result = null;
        Node property;
    String uri;
    jj_consume_token(33);
    uri = Uri();
        property = resolveResource(uri);
        result   = new ReversePropertySelector(property);
        {if (true) return result;}
    throw new Error("Missing return statement in function");
  }

  final public PropertySelector PropertySelector() throws ParseException {
    PropertySelector result = null;
    Node property;
    String uri;
    uri = Uri();
        property = resolveResource(uri);
        result   = new PropertySelector(property);
        {if (true) return result;}
    throw new Error("Missing return statement in function");
  }

  final public WildcardSelector WildcardSelector() throws ParseException {
    WildcardSelector result = null;
    jj_consume_token(29);
        result = new WildcardSelector();
        {if (true) return result;}
    throw new Error("Missing return statement in function");
  }

  final public FunctionSelector FunctionSelector() throws ParseException {
    FunctionSelector result = null;
    List arguments = new ArrayList();
    NodeSelector argument;
    String uri;
    Token fName;
    if (jj_2_42(2147483647)) {
      jj_consume_token(34);
      fName = jj_consume_token(IDENTIFIER);
      jj_consume_token(24);
      jj_consume_token(25);
           uri = namespaces.get("fn") + fName.image;
           result = new FunctionSelector(getFunction(uri),Collections.emptyList());
           {if (true) return result;}
    } else if (jj_2_43(2147483647)) {
      jj_consume_token(34);
      fName = jj_consume_token(IDENTIFIER);
      jj_consume_token(24);
      argument = Selector();
                                    arguments.add(argument);
      label_3:
      while (true) {
        if (jj_2_41(2147483647)) {
          ;
        } else {
          break label_3;
        }
        jj_consume_token(26);
        argument = Selector();
                                          arguments.add(argument);
      }
      jj_consume_token(25);
           uri = namespaces.get("fn") + fName.image;
           result = new FunctionSelector(getFunction(uri),arguments);
           {if (true) return result;}
    } else {
      jj_consume_token(-1);
      throw new ParseException();
    }
    throw new Error("Missing return statement in function");
  }

  final public StringConstantSelector StringConstantSelector() throws ParseException {
    StringConstantSelector result = null;
    Token literal;
    literal = jj_consume_token(STRLIT);
        result = new StringConstantSelector(literal.image.substring(1, literal.image.length()-1));
        {if (true) return result;}
    throw new Error("Missing return statement in function");
  }

  final public NodeTest NodeTest() throws ParseException {
    NodeTest result;
    if (jj_2_44(2147483647)) {
      result = AndTest();
    } else if (jj_2_45(2147483647)) {
      result = OrTest();
    } else if (jj_2_46(2147483647)) {
      result = AtomicNodeTest();
    } else {
      jj_consume_token(-1);
      throw new ParseException();
    }
        {if (true) return result;}
    throw new Error("Missing return statement in function");
  }

  final public NodeTest AtomicNodeTest() throws ParseException {
    NodeTest result;
    if (jj_2_47(2147483647)) {
      result = LiteralLanguageTest();
    } else if (jj_2_48(2147483647)) {
      result = LiteralTypeTest();
    } else if (jj_2_49(2147483647)) {
      result = PathEqualityTest();
    } else if (jj_2_50(2147483647)) {
      result = PathTest();
    } else {
      jj_consume_token(-1);
      throw new ParseException();
    }
        {if (true) return result;}
    throw new Error("Missing return statement in function");
  }

  final public LiteralLanguageTest LiteralLanguageTest() throws ParseException {
    Token lang;
    jj_consume_token(35);
    lang = jj_consume_token(IDENTIFIER);
        {if (true) return new LiteralLanguageTest(lang.image);}
    throw new Error("Missing return statement in function");
  }

  final public LiteralTypeTest LiteralTypeTest() throws ParseException {
    String type;
    jj_consume_token(TYPE);
    type = Uri();
        {if (true) return new LiteralTypeTest(type);}
    throw new Error("Missing return statement in function");
  }

  final public AndTest AndTest() throws ParseException {
    NodeTest left, right;
    left = AtomicNodeTest();
    jj_consume_token(AND);
    right = NodeTest();
        {if (true) return new AndTest(left,right);}
    throw new Error("Missing return statement in function");
  }

  final public OrTest OrTest() throws ParseException {
    NodeTest left, right;
    left = AtomicNodeTest();
    jj_consume_token(OR);
    right = NodeTest();
        {if (true) return new OrTest(left,right);}
    throw new Error("Missing return statement in function");
  }

  final public PathEqualityTest PathEqualityTest() throws ParseException {
    NodeSelector path;
    Node node;
    path = Selector();
    jj_consume_token(IS);
    node = Node();
        {if (true) return new PathEqualityTest(path,node);}
    throw new Error("Missing return statement in function");
  }

  final public Node Node() throws ParseException {
    String uri, type = null;
    Token literal, language;
    if (jj_2_52(2147483647)) {
      uri = Uri();
        {if (true) return resolveResource(uri);}
    } else if (jj_2_53(2147483647)) {
      literal = jj_consume_token(STRLIT);
      if (jj_2_51(2147483647)) {
        jj_consume_token(TYPE);
        type = Uri();
      } else {
        ;
      }
        try {
            {if (true) return backend.createLiteral(literal.image.substring(1, literal.image.length()-1),null,type == null ? null : new URI(type));}
        } catch(java.net.URISyntaxException ex) {
            {if (true) throw new ParseException("could not parse type URI "+type+": "+ex.getMessage());}
            }
    } else if (jj_2_54(2147483647)) {
      literal = jj_consume_token(STRLIT);
      jj_consume_token(35);
      language = jj_consume_token(IDENTIFIER);
        {if (true) return backend.createLiteral(literal.image.substring(1, literal.image.length()-1),new Locale(language.image),null);}
    } else {
      jj_consume_token(-1);
      throw new ParseException();
    }
    throw new Error("Missing return statement in function");
  }

  final public PathTest PathTest() throws ParseException {
    NodeSelector path;
    if (jj_2_55(2147483647)) {
      path = PathSelector();
    } else if (jj_2_56(2147483647)) {
      path = TestingSelector();
    } else if (jj_2_57(2147483647)) {
      path = AtomicSelector();
    } else {
      jj_consume_token(-1);
      throw new ParseException();
    }
        {if (true) return new PathTest(path);}
    throw new Error("Missing return statement in function");
  }

  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_2_4(int xla) {
    jj_la = xla; jj_lastpos = jj_scanpos = token;
    try { return !jj_3_4(); }
    catch(LookaheadSuccess ls) { return true; }
    finally { jj_save(3, xla); }
  }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  private boolean jj_3R_23() {
    Token xsp;
    xsp = jj_scanpos;
    if (jj_3_39()) {
    jj_scanpos = xsp;
    if (jj_3_40()) return true;
    }
    return false;
  }

  private boolean jj_3_39() {
    if (jj_scan_token(24)) return true;
    if (jj_3R_5()) return true;
    if (jj_scan_token(25)) return true;
    if (jj_scan_token(28)) return true;
    return false;
  }

  private boolean jj_3R_28() {
    if (jj_scan_token(35)) return true;
    if (jj_scan_token(IDENTIFIER)) return true;
    return false;
  }

  private boolean jj_3_50() {
    if (jj_3R_31()) return true;
    return false;
  }

  private boolean jj_3_14() {
    if (jj_3R_5()) return true;
    Token xsp;
    xsp = jj_scanpos;
    if (jj_3_9()) jj_scanpos = xsp;
    xsp = jj_scanpos;
    if (jj_3_10()) jj_scanpos = xsp;
    xsp = jj_scanpos;
    if (jj_3_11()) jj_scanpos = xsp;
    return false;
  }

  private boolean jj_3_49() {
    if (jj_3R_30()) return true;
    return false;
  }

  private boolean jj_3_48() {
    if (jj_3R_29()) return true;
    return false;
  }

  private boolean jj_3_47() {
    if (jj_3R_28()) return true;
    return false;
  }

  private boolean jj_3R_24() {
    if (jj_scan_token(24)) return true;
    if (jj_3R_5()) return true;
    if (jj_scan_token(25)) return true;
    return false;
  }

  private boolean jj_3R_27() {
    Token xsp;
    xsp = jj_scanpos;
    if (jj_3_47()) {
    jj_scanpos = xsp;
    if (jj_3_48()) {
    jj_scanpos = xsp;
    if (jj_3_49()) {
    jj_scanpos = xsp;
    if (jj_3_50()) return true;
    }
    }
    }
    return false;
  }

  private boolean jj_3R_17() {
    if (jj_scan_token(27)) return true;
    return false;
  }

  private boolean jj_3_13() {
    if (jj_3R_7()) return true;
    if (jj_scan_token(22)) return true;
    if (jj_3R_5()) return true;
    Token xsp;
    xsp = jj_scanpos;
    if (jj_3_7()) jj_scanpos = xsp;
    xsp = jj_scanpos;
    if (jj_3_8()) jj_scanpos = xsp;
    if (jj_scan_token(19)) return true;
    return false;
  }

  private boolean jj_3_46() {
    if (jj_3R_27()) return true;
    return false;
  }

  private boolean jj_3_45() {
    if (jj_3R_26()) return true;
    return false;
  }

  private boolean jj_3_44() {
    if (jj_3R_25()) return true;
    return false;
  }

  private boolean jj_3_38() {
    if (jj_3R_24()) return true;
    return false;
  }

  private boolean jj_3R_4() {
    Token xsp;
    xsp = jj_scanpos;
    if (jj_3_44()) {
    jj_scanpos = xsp;
    if (jj_3_45()) {
    jj_scanpos = xsp;
    if (jj_3_46()) return true;
    }
    }
    return false;
  }

  private boolean jj_3_37() {
    if (jj_3R_23()) return true;
    return false;
  }

  private boolean jj_3_12() {
    if (jj_scan_token(IDENTIFIER)) return true;
    if (jj_scan_token(22)) return true;
    if (jj_3R_5()) return true;
    Token xsp;
    xsp = jj_scanpos;
    if (jj_3_5()) jj_scanpos = xsp;
    xsp = jj_scanpos;
    if (jj_3_6()) jj_scanpos = xsp;
    if (jj_scan_token(19)) return true;
    return false;
  }

  private boolean jj_3R_6() {
    Token xsp;
    xsp = jj_scanpos;
    if (jj_3_12()) {
    jj_scanpos = xsp;
    if (jj_3_13()) {
    jj_scanpos = xsp;
    if (jj_3_14()) return true;
    }
    }
    return false;
  }

  private boolean jj_3_36() {
    if (jj_3R_22()) return true;
    return false;
  }

  private boolean jj_3_35() {
    if (jj_3R_21()) return true;
    return false;
  }

  private boolean jj_3_34() {
    if (jj_3R_20()) return true;
    return false;
  }

  private boolean jj_3R_22() {
    if (jj_scan_token(STRLIT)) return true;
    return false;
  }

  private boolean jj_3_33() {
    if (jj_3R_19()) return true;
    return false;
  }

  private boolean jj_3_32() {
    if (jj_3R_18()) return true;
    return false;
  }

  private boolean jj_3_41() {
    if (jj_scan_token(26)) return true;
    if (jj_3R_5()) return true;
    return false;
  }

  private boolean jj_3_31() {
    if (jj_3R_17()) return true;
    return false;
  }

  private boolean jj_3_4() {
    if (jj_3R_6()) return true;
    return false;
  }

  private boolean jj_3R_12() {
    Token xsp;
    xsp = jj_scanpos;
    if (jj_3_31()) {
    jj_scanpos = xsp;
    if (jj_3_32()) {
    jj_scanpos = xsp;
    if (jj_3_33()) {
    jj_scanpos = xsp;
    if (jj_3_34()) {
    jj_scanpos = xsp;
    if (jj_3_35()) {
    jj_scanpos = xsp;
    if (jj_3_36()) {
    jj_scanpos = xsp;
    if (jj_3_37()) {
    jj_scanpos = xsp;
    if (jj_3_38()) return true;
    }
    }
    }
    }
    }
    }
    }
    return false;
  }

  private boolean jj_3_43() {
    if (jj_scan_token(34)) return true;
    if (jj_scan_token(IDENTIFIER)) return true;
    if (jj_scan_token(24)) return true;
    if (jj_3R_5()) return true;
    Token xsp;
    while (true) {
      xsp = jj_scanpos;
      if (jj_3_41()) { jj_scanpos = xsp; break; }
    }
    if (jj_scan_token(25)) return true;
    return false;
  }

  private boolean jj_3_3() {
    if (jj_scan_token(21)) return true;
    if (jj_3R_5()) return true;
    if (jj_scan_token(19)) return true;
    return false;
  }

  private boolean jj_3_30() {
    if (jj_3R_12()) return true;
    return false;
  }

  private boolean jj_3R_21() {
    Token xsp;
    xsp = jj_scanpos;
    if (jj_3_42()) {
    jj_scanpos = xsp;
    if (jj_3_43()) return true;
    }
    return false;
  }

  private boolean jj_3_29() {
    if (jj_3R_11()) return true;
    return false;
  }

  private boolean jj_3_42() {
    if (jj_scan_token(34)) return true;
    if (jj_scan_token(IDENTIFIER)) return true;
    if (jj_scan_token(24)) return true;
    if (jj_scan_token(25)) return true;
    return false;
  }

  private boolean jj_3_2() {
    if (jj_scan_token(20)) return true;
    if (jj_3R_4()) return true;
    if (jj_scan_token(19)) return true;
    return false;
  }

  private boolean jj_3R_16() {
    Token xsp;
    xsp = jj_scanpos;
    if (jj_3_29()) {
    jj_scanpos = xsp;
    if (jj_3_30()) return true;
    }
    return false;
  }

  private boolean jj_3_1() {
    if (jj_scan_token(15)) return true;
    if (jj_scan_token(IDENTIFIER)) return true;
    if (jj_scan_token(16)) return true;
    if (jj_scan_token(17)) return true;
    if (jj_scan_token(URI)) return true;
    if (jj_scan_token(18)) return true;
    if (jj_scan_token(19)) return true;
    return false;
  }

  private boolean jj_3_28() {
    if (jj_3R_16()) return true;
    return false;
  }

  private boolean jj_3_27() {
    if (jj_3R_15()) return true;
    return false;
  }

  private boolean jj_3R_32() {
    Token xsp;
    xsp = jj_scanpos;
    if (jj_3_27()) {
    jj_scanpos = xsp;
    if (jj_3_28()) return true;
    }
    return false;
  }

  private boolean jj_3R_19() {
    if (jj_scan_token(29)) return true;
    return false;
  }

  private boolean jj_3R_18() {
    if (jj_3R_7()) return true;
    return false;
  }

  private boolean jj_3_26() {
    if (jj_3R_15()) return true;
    return false;
  }

  private boolean jj_3_25() {
    if (jj_3R_14()) return true;
    return false;
  }

  private boolean jj_3_24() {
    if (jj_3R_13()) return true;
    return false;
  }

  private boolean jj_3_57() {
    if (jj_3R_12()) return true;
    return false;
  }

  private boolean jj_3_56() {
    if (jj_3R_11()) return true;
    return false;
  }

  private boolean jj_3_55() {
    if (jj_3R_15()) return true;
    return false;
  }

  private boolean jj_3R_20() {
    if (jj_scan_token(33)) return true;
    if (jj_3R_7()) return true;
    return false;
  }

  private boolean jj_3_51() {
    if (jj_scan_token(TYPE)) return true;
    if (jj_3R_7()) return true;
    return false;
  }

  private boolean jj_3R_10() {
    Token xsp;
    xsp = jj_scanpos;
    if (jj_3_24()) {
    jj_scanpos = xsp;
    if (jj_3_25()) {
    jj_scanpos = xsp;
    if (jj_3_26()) return true;
    }
    }
    return false;
  }

  private boolean jj_3R_31() {
    Token xsp;
    xsp = jj_scanpos;
    if (jj_3_55()) {
    jj_scanpos = xsp;
    if (jj_3_56()) {
    jj_scanpos = xsp;
    if (jj_3_57()) return true;
    }
    }
    return false;
  }

  private boolean jj_3_15() {
    if (jj_scan_token(26)) return true;
    if (jj_3R_8()) return true;
    return false;
  }

  private boolean jj_3_23() {
    if (jj_3R_12()) return true;
    return false;
  }

  private boolean jj_3_11() {
    if (jj_scan_token(19)) return true;
    return false;
  }

  private boolean jj_3_22() {
    if (jj_3R_11()) return true;
    return false;
  }

  private boolean jj_3_21() {
    if (jj_3R_10()) return true;
    return false;
  }

  private boolean jj_3_54() {
    if (jj_scan_token(STRLIT)) return true;
    if (jj_scan_token(35)) return true;
    if (jj_scan_token(IDENTIFIER)) return true;
    return false;
  }

  private boolean jj_3R_11() {
    if (jj_3R_12()) return true;
    if (jj_scan_token(31)) return true;
    if (jj_3R_4()) return true;
    if (jj_scan_token(32)) return true;
    return false;
  }

  private boolean jj_3R_5() {
    Token xsp;
    xsp = jj_scanpos;
    if (jj_3_21()) {
    jj_scanpos = xsp;
    if (jj_3_22()) {
    jj_scanpos = xsp;
    if (jj_3_23()) return true;
    }
    }
    return false;
  }

  private boolean jj_3_53() {
    if (jj_scan_token(STRLIT)) return true;
    Token xsp;
    xsp = jj_scanpos;
    if (jj_3_51()) jj_scanpos = xsp;
    return false;
  }

  private boolean jj_3R_33() {
    Token xsp;
    xsp = jj_scanpos;
    if (jj_3_52()) {
    jj_scanpos = xsp;
    if (jj_3_53()) {
    jj_scanpos = xsp;
    if (jj_3_54()) return true;
    }
    }
    return false;
  }

  private boolean jj_3_52() {
    if (jj_3R_7()) return true;
    return false;
  }

  private boolean jj_3_20() {
    if (jj_scan_token(IDENTIFIER)) return true;
    if (jj_scan_token(16)) return true;
    if (jj_scan_token(IDENTIFIER)) return true;
    return false;
  }

  private boolean jj_3R_13() {
    if (jj_3R_32()) return true;
    if (jj_scan_token(OR)) return true;
    if (jj_3R_5()) return true;
    return false;
  }

  private boolean jj_3_19() {
    if (jj_scan_token(17)) return true;
    if (jj_scan_token(URI)) return true;
    if (jj_scan_token(18)) return true;
    return false;
  }

  private boolean jj_3R_7() {
    Token xsp;
    xsp = jj_scanpos;
    if (jj_3_19()) {
    jj_scanpos = xsp;
    if (jj_3_20()) return true;
    }
    return false;
  }

  private boolean jj_3R_30() {
    if (jj_3R_5()) return true;
    if (jj_scan_token(IS)) return true;
    if (jj_3R_33()) return true;
    return false;
  }

  private boolean jj_3_18() {
    if (jj_scan_token(IDENTIFIER)) return true;
    return false;
  }

  private boolean jj_3_17() {
    if (jj_scan_token(STRLIT)) return true;
    return false;
  }

  private boolean jj_3R_9() {
    Token xsp;
    xsp = jj_scanpos;
    if (jj_3_17()) {
    jj_scanpos = xsp;
    if (jj_3_18()) return true;
    }
    return false;
  }

  private boolean jj_3_8() {
    if (jj_scan_token(24)) return true;
    if (jj_3R_8()) return true;
    if (jj_scan_token(25)) return true;
    return false;
  }

  private boolean jj_3_6() {
    if (jj_scan_token(24)) return true;
    if (jj_3R_8()) return true;
    if (jj_scan_token(25)) return true;
    return false;
  }

  private boolean jj_3_10() {
    if (jj_scan_token(24)) return true;
    if (jj_3R_8()) return true;
    if (jj_scan_token(25)) return true;
    return false;
  }

  private boolean jj_3R_14() {
    if (jj_3R_32()) return true;
    if (jj_scan_token(AND)) return true;
    if (jj_3R_5()) return true;
    return false;
  }

  private boolean jj_3R_26() {
    if (jj_3R_27()) return true;
    if (jj_scan_token(OR)) return true;
    if (jj_3R_4()) return true;
    return false;
  }

  private boolean jj_3_16() {
    if (jj_scan_token(IDENTIFIER)) return true;
    if (jj_scan_token(22)) return true;
    if (jj_3R_9()) return true;
    Token xsp;
    xsp = jj_scanpos;
    if (jj_3_15()) jj_scanpos = xsp;
    return false;
  }

  private boolean jj_3R_8() {
    Token xsp;
    xsp = jj_scanpos;
    if (jj_3_16()) jj_scanpos = xsp;
    return false;
  }

  private boolean jj_3R_25() {
    if (jj_3R_27()) return true;
    if (jj_scan_token(AND)) return true;
    if (jj_3R_4()) return true;
    return false;
  }

  private boolean jj_3R_15() {
    if (jj_3R_16()) return true;
    if (jj_scan_token(30)) return true;
    if (jj_3R_32()) return true;
    return false;
  }

  private boolean jj_3_7() {
    if (jj_scan_token(23)) return true;
    if (jj_3R_7()) return true;
    return false;
  }

  private boolean jj_3_5() {
    if (jj_scan_token(23)) return true;
    if (jj_3R_7()) return true;
    return false;
  }

  private boolean jj_3_9() {
    if (jj_scan_token(23)) return true;
    if (jj_3R_7()) return true;
    return false;
  }

  private boolean jj_3R_29() {
    if (jj_scan_token(TYPE)) return true;
    if (jj_3R_7()) return true;
    return false;
  }

  private boolean jj_3_40() {
    if (jj_scan_token(24)) return true;
    if (jj_3R_5()) return true;
    if (jj_scan_token(25)) return true;
    if (jj_scan_token(29)) return true;
    return false;
  }

  /** Generated Token Manager. */
  public RdfPathParserTokenManager token_source;
  SimpleCharStream jj_input_stream;
  /** Current token. */
  public Token token;
  /** Next token. */
  public Token jj_nt;
  private Token jj_scanpos, jj_lastpos;
  private int jj_la;
  private int jj_gen;
  final private int[] jj_la1 = new int[0];
  static private int[] jj_la1_0;
  static private int[] jj_la1_1;
  static {
      jj_la1_init_0();
      jj_la1_init_1();
   }
   private static void jj_la1_init_0() {
      jj_la1_0 = new int[] {};
   }
   private static void jj_la1_init_1() {
      jj_la1_1 = new int[] {};
   }
  final private JJCalls[] jj_2_rtns = new JJCalls[57];
  private boolean jj_rescan = false;
  private int jj_gc = 0;

  /** Constructor with InputStream. */
  public RdfPathParser(java.io.InputStream stream) {
     this(stream, null);
  }
  /** Constructor with InputStream and supplied encoding */
  public RdfPathParser(java.io.InputStream stream, String encoding) {
    try { jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
    token_source = new RdfPathParserTokenManager(jj_input_stream);
    token = new Token();
    token.next = jj_nt = token_source.getNextToken();
    jj_gen = 0;
    for (int i = 0; i < 0; 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(java.io.InputStream stream) {
     ReInit(stream, null);
  }
  /** Reinitialise. */
  public void ReInit(java.io.InputStream stream, String encoding) {
    try { jj_input_stream.ReInit(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
    token_source.ReInit(jj_input_stream);
    token = new Token();
    token.next = jj_nt = token_source.getNextToken();
    jj_gen = 0;
    for (int i = 0; i < 0; i++) jj_la1[i] = -1;
    for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
  }

  /** Constructor. */
  public RdfPathParser(java.io.Reader stream) {
    jj_input_stream = new SimpleCharStream(stream, 1, 1);
    token_source = new RdfPathParserTokenManager(jj_input_stream);
    token = new Token();
    token.next = jj_nt = token_source.getNextToken();
    jj_gen = 0;
    for (int i = 0; i < 0; 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(java.io.Reader stream) {
    jj_input_stream.ReInit(stream, 1, 1);
    token_source.ReInit(jj_input_stream);
    token = new Token();
    token.next = jj_nt = token_source.getNextToken();
    jj_gen = 0;
    for (int i = 0; i < 0; 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 RdfPathParser(RdfPathParserTokenManager tm) {
    token_source = tm;
    token = new Token();
    token.next = jj_nt = token_source.getNextToken();
    jj_gen = 0;
    for (int i = 0; i < 0; 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(RdfPathParserTokenManager tm) {
    token_source = tm;
    token = new Token();
    token.next = jj_nt = token_source.getNextToken();
    jj_gen = 0;
    for (int i = 0; i < 0; 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 = token;
    if ((token = jj_nt).next != null) jj_nt = jj_nt.next;
    else jj_nt = jj_nt.next = token_source.getNextToken();
    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;
    }
    jj_nt = 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 = jj_nt).next != null) jj_nt = jj_nt.next;
    else jj_nt = jj_nt.next = token_source.getNextToken();
    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 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[36];
    if (jj_kind >= 0) {
      la1tokens[jj_kind] = true;
      jj_kind = -1;
    }
    for (int i = 0; i < 0; 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;
            case 3: jj_3_4(); break;
            case 4: jj_3_5(); break;
            case 5: jj_3_6(); break;
            case 6: jj_3_7(); break;
            case 7: jj_3_8(); break;
            case 8: jj_3_9(); break;
            case 9: jj_3_10(); break;
            case 10: jj_3_11(); break;
            case 11: jj_3_12(); break;
            case 12: jj_3_13(); break;
            case 13: jj_3_14(); break;
            case 14: jj_3_15(); break;
            case 15: jj_3_16(); break;
            case 16: jj_3_17(); break;
            case 17: jj_3_18(); break;
            case 18: jj_3_19(); break;
            case 19: jj_3_20(); break;
            case 20: jj_3_21(); break;
            case 21: jj_3_22(); break;
            case 22: jj_3_23(); break;
            case 23: jj_3_24(); break;
            case 24: jj_3_25(); break;
            case 25: jj_3_26(); break;
            case 26: jj_3_27(); break;
            case 27: jj_3_28(); break;
            case 28: jj_3_29(); break;
            case 29: jj_3_30(); break;
            case 30: jj_3_31(); break;
            case 31: jj_3_32(); break;
            case 32: jj_3_33(); break;
            case 33: jj_3_34(); break;
            case 34: jj_3_35(); break;
            case 35: jj_3_36(); break;
            case 36: jj_3_37(); break;
            case 37: jj_3_38(); break;
            case 38: jj_3_39(); break;
            case 39: jj_3_40(); break;
            case 40: jj_3_41(); break;
            case 41: jj_3_42(); break;
            case 42: jj_3_43(); break;
            case 43: jj_3_44(); break;
            case 44: jj_3_45(); break;
            case 45: jj_3_46(); break;
            case 46: jj_3_47(); break;
            case 47: jj_3_48(); break;
            case 48: jj_3_49(); break;
            case 49: jj_3_50(); break;
            case 50: jj_3_51(); break;
            case 51: jj_3_52(); break;
            case 52: jj_3_53(); break;
            case 53: jj_3_54(); break;
            case 54: jj_3_55(); break;
            case 55: jj_3_56(); break;
            case 56: jj_3_57(); 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 - 2024 Weber Informatics LLC | Privacy Policy