Class AbstractGrammar

    • Field Detail

      • transitions

        protected HashMap<Tag,​GrammarTransition>[] transitions
        Table of transitions. It's a two dimension array, the first dimension indexes the states, the second dimension indexes the Tag value, so it is 256 wide.
      • name

        protected String name
        The grammar name
    • Constructor Detail

      • AbstractGrammar

        public AbstractGrammar()
    • Method Detail

      • getName

        public String getName()
        Returns the grammar's name
        Specified by:
        getName in interface Grammar
        Returns:
        The grammar name
      • setName

        public void setName​(String name)
        Sets the grammar's name
        Specified by:
        setName in interface Grammar
        Parameters:
        name - the name to set
      • getTransition

        public GrammarTransition getTransition​(Enum<Dsmlv2StatesEnum> state,
                                               Tag tag)
        Gets the transition associated with the state and tag
        Parameters:
        state - The current state
        tag - The current tag
        Returns:
        A valid transition if any, or null.