Class Rule.Parser

Enclosing class:

public static class Rule.Parser extends Object
Inner class which provides minimalist parsing support based on tokenisation with depth 1 lookahead. No sensible error reporting on offer. No embedded spaces supported.
  • Method Details

    • registerPrefix

      public void registerPrefix(String prefix, String namespace)
      Register a new namespace prefix with the parser
    • registerPrefixMap

      public void registerPrefixMap(Map<String,String> map)
      Register a set of prefix to namespace mappings with the parser
    • getPrefixMap

      public Map<String,String> getPrefixMap()
      Return a map of all the discovered prefixes
    • getRulesPreload

      public List<Rule> getRulesPreload()
      Return the complete set of preloaded rules;
    • recentTokens

      public String recentTokens()
      Return a trace of the recently seen tokens, for use in error reporting
    • parseRule

      public Rule parseRule()
      Parse a rule, terminated by a "]" or "." character.